MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / listCertFiles

Function listCertFiles

tools/get_checkers.py:929–944  ·  view source on GitHub ↗

Lists the rules and recommendation files for one part of the standard.

(content_subdir:str)

Source from the content-addressed store, hash-verified

927_cert_tree = None
928
929def listCertFiles(content_subdir:str):
930 """Lists the rules and recommendation files for one part of the standard."""
931 global _cert_tree
932 if _cert_tree is None:
933 url = 'https://api.github.com/repos/%s/git/trees/%s?recursive=1' % (CERT_REPO, CERT_BRANCH)
934 _cert_tree = requests.get(url, timeout=50).json()['tree']
935 prefix = 'content/' + content_subdir
936 files = []
937 for entry in _cert_tree:
938 path = entry['path']
939 if entry['type'] != 'blob' or not path.startswith(prefix) or not path.endswith('.md'):
940 continue
941 if 'index' in path.rsplit('/', 1)[-1].lower():
942 continue
943 files.append(path)
944 return sorted(files)
945
946def printCertCInfo(content_subdir:str):
947 """Fetches CERT C rules information."""

Callers 1

printCertCInfoFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected