best-doctor/import_me

View on GitHub
import_me/parsers/base.py

Summary

Maintainability
A
2 hrs
Test Coverage
B
81%

Function clean_unique_together_values has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def clean_unique_together_values(
        self, row_data: Dict, row: List[Any], row_index: int, worksheet_title: str = None,
    ) -> Dict:
        is_not_unique_row = False

Severity: Minor
Found in import_me/parsers/base.py - About 55 mins to fix

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 add_errors has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def add_errors(
        self,
        messages: Union[str, List],
        row_index: int = None,
        col_index: int = None,
Severity: Minor
Found in import_me/parsers/base.py - About 45 mins to fix

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 parse_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_data(self, raise_errors: bool = False, *args: Any, **kwargs: Any) -> None:
        for file_path in self.get_file_paths():
            try:
                parser = self.parser_class(file_path)
                parser(raise_errors=raise_errors)
Severity: Minor
Found in import_me/parsers/base.py - About 35 mins to fix

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

There are no issues that match your filters.

Category
Status