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

Function fmt

tools/donate-cpu-server.py:139–161  ·  view source on GitHub ↗
(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True, column_width=None)

Source from the content-addressed store, hash-verified

137
138
139def fmt(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True, column_width=None) -> str:
140 if column_width is None:
141 column_width = [40, 10, 5, 7, 7, 8]
142 ret = a
143 while len(ret) < column_width[0]:
144 ret += ' '
145 if len(ret) == column_width[0]:
146 ret += ' ' + b[:10]
147 while len(ret) < (column_width[0] + 1 + column_width[1]):
148 ret += ' '
149 ret += ' '
150 if len(b) > 10:
151 ret += b[-5:].rjust(column_width[2]) + ' '
152 if c is not None:
153 ret += c.rjust(column_width[3]) + ' '
154 if d is not None:
155 ret += d.rjust(column_width[4]) + ' '
156 if e is not None:
157 ret += e.rjust(column_width[5])
158 if link:
159 pos = ret.find(' ')
160 ret = '<a href="' + a + '">' + a + '</a>' + ret[pos:]
161 return ret
162
163
164def latestReport(latestResults: list) -> str:

Callers 6

latestReportFunction · 0.85
crashReportFunction · 0.85
timeoutReportFunction · 0.85
staleReportFunction · 0.85
timeReportFunction · 0.85
timeReportSlowFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected