Method: pylint.lint.pylinter.PyLinter._report_evaluation
Calls: 213, Exceptions: 0, Paths: 5Back
Path 1: 94 calls (0.44)
7.5 (28) 0 (25) 10.0 (23) -10.0 (10) 9.523809523809524 (3) 7.777777777777778 (2) 9.285714285714286 (2) 9.642857142857142 (1)
1def _report_evaluation(self) -> int | None:
2 """Make the global evaluation report."""
3 # check with at least check 1 statements (usually 0 when there is a
4 # syntax error preventing pylint from further processing)
5 note = None
6 # TODO: 3.0: Remove assertion
7 assert self.file_state.base_name is not None
8 previous_stats = load_results(self.file_state.base_name)
9 if self.stats.statement == 0:
10 return note
11
12 # get a global note for the code
13 evaluation = self.config.evaluation
14 try:
15 stats_dict = {
16 "fatal": self.stats.fatal,
17 "error": self.stats.error,
18 "warning": self.stats.warning,
19 "refactor": self.stats.refactor,
20 "convention": self.stats.convention,
21 "statement": self.stats.statement,
22 "info": self.stats.info,
23 }
24 note = eval(evaluation, {}, stats_dict) # pylint: disable=eval-used
25 except Exception as ex: # pylint: disable=broad-except
26 msg = f"An exception occurred while rating: {ex}"
27 else:
28 self.stats.global_note = note
29 msg = f"Your code has been rated at {note:.2f}/10"
30 if previous_stats:
31 pnote = previous_stats.global_note
32 if pnote is not None:
33 msg += f" (previous run: {pnote:.2f}/10, {note - pnote:+.2f})"
34
35 if self.config.score:
36 sect = report_nodes.EvaluationSection(msg)
37 self.reporter.display_reports(sect)
38 return note
Path 2: 93 calls (0.44)
None (93)
1def _report_evaluation(self) -> int | None:
2 """Make the global evaluation report."""
3 # check with at least check 1 statements (usually 0 when there is a
4 # syntax error preventing pylint from further processing)
5 note = None
6 # TODO: 3.0: Remove assertion
7 assert self.file_state.base_name is not None
8 previous_stats = load_results(self.file_state.base_name)
9 if self.stats.statement == 0:
10 return note
11
12 # get a global note for the code
13 evaluation = self.config.evaluation
14 try:
15 stats_dict = {
16 "fatal": self.stats.fatal,
17 "error": self.stats.error,
18 "warning": self.stats.warning,
19 "refactor": self.stats.refactor,
20 "convention": self.stats.convention,
21 "statement": self.stats.statement,
22 "info": self.stats.info,
23 }
24 note = eval(evaluation, {}, stats_dict) # pylint: disable=eval-used
25 except Exception as ex: # pylint: disable=broad-except
26 msg = f"An exception occurred while rating: {ex}"
27 else:
28 self.stats.global_note = note
29 msg = f"Your code has been rated at {note:.2f}/10"
30 if previous_stats:
31 pnote = previous_stats.global_note
32 if pnote is not None:
33 msg += f" (previous run: {pnote:.2f}/10, {note - pnote:+.2f})"
34
35 if self.config.score:
36 sect = report_nodes.EvaluationSection(msg)
37 self.reporter.display_reports(sect)
38 return note
Path 3: 18 calls (0.08)
10.0 (13) 0 (4) 5.0 (1)
1def _report_evaluation(self) -> int | None:
2 """Make the global evaluation report."""
3 # check with at least check 1 statements (usually 0 when there is a
4 # syntax error preventing pylint from further processing)
5 note = None
6 # TODO: 3.0: Remove assertion
7 assert self.file_state.base_name is not None
8 previous_stats = load_results(self.file_state.base_name)
9 if self.stats.statement == 0:
10 return note
11
12 # get a global note for the code
13 evaluation = self.config.evaluation
14 try:
15 stats_dict = {
16 "fatal": self.stats.fatal,
17 "error": self.stats.error,
18 "warning": self.stats.warning,
19 "refactor": self.stats.refactor,
20 "convention": self.stats.convention,
21 "statement": self.stats.statement,
22 "info": self.stats.info,
23 }
24 note = eval(evaluation, {}, stats_dict) # pylint: disable=eval-used
25 except Exception as ex: # pylint: disable=broad-except
26 msg = f"An exception occurred while rating: {ex}"
27 else:
28 self.stats.global_note = note
29 msg = f"Your code has been rated at {note:.2f}/10"
30 if previous_stats:
31 pnote = previous_stats.global_note
32 if pnote is not None:
33 msg += f" (previous run: {pnote:.2f}/10, {note - pnote:+.2f})"
34
35 if self.config.score:
36 sect = report_nodes.EvaluationSection(msg)
37 self.reporter.display_reports(sect)
38 return note
Path 4: 5 calls (0.02)
7.5 (2) 0 (2) 10.0 (1)
1def _report_evaluation(self) -> int | None:
2 """Make the global evaluation report."""
3 # check with at least check 1 statements (usually 0 when there is a
4 # syntax error preventing pylint from further processing)
5 note = None
6 # TODO: 3.0: Remove assertion
7 assert self.file_state.base_name is not None
8 previous_stats = load_results(self.file_state.base_name)
9 if self.stats.statement == 0:
10 return note
11
12 # get a global note for the code
13 evaluation = self.config.evaluation
14 try:
15 stats_dict = {
16 "fatal": self.stats.fatal,
17 "error": self.stats.error,
18 "warning": self.stats.warning,
19 "refactor": self.stats.refactor,
20 "convention": self.stats.convention,
21 "statement": self.stats.statement,
22 "info": self.stats.info,
23 }
24 note = eval(evaluation, {}, stats_dict) # pylint: disable=eval-used
25 except Exception as ex: # pylint: disable=broad-except
26 msg = f"An exception occurred while rating: {ex}"
27 else:
28 self.stats.global_note = note
29 msg = f"Your code has been rated at {note:.2f}/10"
30 if previous_stats:
31 pnote = previous_stats.global_note
32 if pnote is not None:
33 msg += f" (previous run: {pnote:.2f}/10, {note - pnote:+.2f})"
34
35 if self.config.score:
36 sect = report_nodes.EvaluationSection(msg)
37 self.reporter.display_reports(sect)
38 return note
Path 5: 3 calls (0.01)
10.0 (1) 0 (1) 5.0 (1)
1def _report_evaluation(self) -> int | None:
2 """Make the global evaluation report."""
3 # check with at least check 1 statements (usually 0 when there is a
4 # syntax error preventing pylint from further processing)
5 note = None
6 # TODO: 3.0: Remove assertion
7 assert self.file_state.base_name is not None
8 previous_stats = load_results(self.file_state.base_name)
9 if self.stats.statement == 0:
10 return note
11
12 # get a global note for the code
13 evaluation = self.config.evaluation
14 try:
15 stats_dict = {
16 "fatal": self.stats.fatal,
17 "error": self.stats.error,
18 "warning": self.stats.warning,
19 "refactor": self.stats.refactor,
20 "convention": self.stats.convention,
21 "statement": self.stats.statement,
22 "info": self.stats.info,
23 }
24 note = eval(evaluation, {}, stats_dict) # pylint: disable=eval-used
25 except Exception as ex: # pylint: disable=broad-except
26 msg = f"An exception occurred while rating: {ex}"
27 else:
28 self.stats.global_note = note
29 msg = f"Your code has been rated at {note:.2f}/10"
30 if previous_stats:
31 pnote = previous_stats.global_note
32 if pnote is not None:
33 msg += f" (previous run: {pnote:.2f}/10, {note - pnote:+.2f})"
34
35 if self.config.score:
36 sect = report_nodes.EvaluationSection(msg)
37 self.reporter.display_reports(sect)
38 return note