sonntagsgesicht/unicum

View on GitHub

Showing 27 of 90 total issues

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

    def to_serializable(self, level=0, all_properties_flag=False, recursive=True):
        r = list()
        for v in self:
            if recursive:
                v = v if not hasattr(v, 'to_serializable') else v.to_serializable(level + 1, all_properties_flag)
Severity: Minor
Found in unicum/persistentobject.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 decode_dict has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def decode_dict(data):
    rv = {}
    for key, value in data.items():
        if isinstance(key, basestring):  # 2to3 20190915
            key = str(key)  # key.encode('utf-8').decode('ascii')  # 2to3 20190915
Severity: Minor
Found in unicum/decode_json.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 update_link has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def update_link(self):
        """
        redirects all links to self (the new linked object)
        """
        name = repr(self)
Severity: Minor
Found in unicum/linkedobject.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 _modify_property has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _modify_property(self, property_name, property_value_variant):
        # avoid circles
        if property_value_variant is self:
            msg = 'Attributes must not be recursively. Not mapping self to %s.' % property_name
            _logger.error(msg)
Severity: Minor
Found in unicum/persistentobject.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

Function remove_link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def remove_link(self, obj, attr=None):
        """
        removes link from obj.attr
        """
        name = repr(self)
Severity: Minor
Found in unicum/linkedobject.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

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

    def __getslice__(self, i, j):
        self._update_cache()
        if not isinstance(i, (tuple, list)):
            l = len(self._col_keys)
            return self[(i, 0):(j, l)]
Severity: Minor
Found in unicum/datarange.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 __slice_nested_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __slice_nested_list(iterable):
        if not iterable:
            return list(), list(), list()

        # extract column headers from first row
Severity: Minor
Found in unicum/datarange.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