KarrLab/obj_tables

View on GitHub

Showing 425 of 542 total issues

Function _delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _delete(self, model_obj):
        """ Delete an :obj:`model_obj` from the indices

        Args:
            model_obj (:obj:`Model`): a :obj:`Model` instance
Severity: Minor
Found in obj_tables/core.py - About 25 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 _gc_weaksets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _gc_weaksets(self):
        """ Garbage collect empty WeakSets formed by deletion of weak refs to :obj:`Model` instances with no strong refs

        Returns:
            :obj:`int`: number of empty WeakSets deleted
Severity: Minor
Found in obj_tables/core.py - About 25 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 _dump_index_dicts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _dump_index_dicts(self, file=None):
        """ Dump the index dictionaries for debugging

        Args:
            file (:obj:`object`, optitonal): an object with a :obj:`write(string)` method
Severity: Minor
Found in obj_tables/core.py - About 25 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_attr_path_el has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_attr_path_el(cls, attr):
        """ Parse an element of a path to a nested attribute

        Args:
            attr (:obj:`list` of :obj:`dict`): an element of a path to a nested attribute
Severity: Minor
Found in obj_tables/core.py - About 25 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_worksheet_heading_metadata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_worksheet_heading_metadata(cls, heading, sheet_name=None):
        """ Parse key-value pairs of metadata from heading

        Args:
            heading (:obj:`str`): heading with key-value pairs of metadata
Severity: Minor
Found in obj_tables/io.py - About 25 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

Severity
Category
Status
Source
Language