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

Function messageIdReport

tools/donate-cpu-server.py:662–696  ·  view source on GitHub ↗
(resultPath: str, marker: str, messageId: str, query_params: dict)

Source from the content-addressed store, hash-verified

660
661
662def messageIdReport(resultPath: str, marker: str, messageId: str, query_params: dict) -> str:
663 pkgs = '' if query_params.get('pkgs') == '1' else None
664 text = messageId + '\n'
665 e = '[' + messageId + ']\n'
666 for filename in sorted(glob.glob(resultPath + '/*')):
667 if not os.path.isfile(filename) or filename.endswith('.diff'):
668 continue
669 url = None
670 inResults = False
671 for line in open(filename, 'rt'):
672 if line.startswith('cppcheck: '):
673 if OLD_VERSION not in line:
674 # Package results seem to be too old, skip
675 break
676 # Current package, parse on
677 continue
678 if line.startswith('ftp://'):
679 url = line
680 continue
681 if not inResults:
682 if line.startswith(marker):
683 inResults = True
684 continue
685 if line.startswith('diff:'):
686 break
687 if line.endswith(e):
688 if url:
689 text += url
690 if pkgs is not None:
691 pkgs += url
692 url = None
693 text += line
694 if pkgs is not None:
695 return pkgs
696 return text
697
698
699def headMessageIdReport(resultPath: str, messageId: str, query_params: dict) -> str:

Callers 2

headMessageIdReportFunction · 0.85
infoMessageIdReportFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected