File metric_handler.py
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""metric handlers and basic class for calculating metrics"""
from __future__ import annotations
from abc import ABC, abstractmethod
import re
Function no_petitio
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def no_petitio(parsed_pred: Optional[Argument]) -> Optional[int]:
"""checks if a reconstruction is no petitio
i.e. no conclusion is a premise,
petitio is a special case of redundancy"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function compute_metrics
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compute_metrics(self, predictions: List[str], references: List[str]):
"""
compute da2 metrics of predictions given references
Args:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function consistent_usage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def consistent_usage(parsed_pred: Optional[Argument]) -> Optional[int]:
"""checks if info about used statements is consistent"""
if parsed_pred is None:
return None
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function score
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def score(
self,
pred_as_formulae: Optional[List[Optional[Formalization]]],
ref_as_formulae: Optional[List[Optional[Formalization]]],
):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return self._MIN_SCORES
Avoid too many return
statements within this function. Open
return scores