MCPcopy
hub / github.com/PyCQA/flake8 / record

Method record

src/flake8/statistics.py:25–35  ·  view source on GitHub ↗

Add the fact that the error was seen in the file. :param error: The Violation instance containing the information about the violation.

(self, error: Violation)

Source from the content-addressed store, hash-verified

23 return sorted({key.code for key in self._store})
24
25 def record(self, error: Violation) -> None:
26 """Add the fact that the error was seen in the file.
27
28 :param error:
29 The Violation instance containing the information about the
30 violation.
31 """
32 key = Key.create_from(error)
33 if key not in self._store:
34 self._store[key] = Statistic.create_from(error)
35 self._store[key].increment()
36
37 def statistics_for(
38 self, prefix: str, filename: str | None = None

Calls 2

incrementMethod · 0.80
create_fromMethod · 0.45