alexbahnisch/pyplus

View on GitHub

Showing 28 of 28 total issues

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

    def merge(self, *others):
        if all(isinstance(other, list) for other in others):
            for other in others:
                for index, item in enumerate(other):
                    self._merge(index, item)
Severity: Minor
Found in src/main/pyplus/json.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 merge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def merge(self, *others):
        if all(isinstance(other, dict) for other in others):
            for other in others:
                for key, value in other.items():
                    self._merge(key, value)
Severity: Minor
Found in src/main/pyplus/json.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 assign has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def assign(self, *others):
        if all(isinstance(other, dict) for other in others):
            for other in others:
                for key, value in other.items():
                    self[key] = value
Severity: Minor
Found in src/main/pyplus/json.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, *args, **kwargs):
        kwargs = _OrderedDict(kwargs)

        if len(args) == 1:
            if isinstance(args[0], dict):
Severity: Minor
Found in src/main/pyplus/json.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 dataobject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def dataobject(*headers):
    """
    Class decorator to mixin DataObjectMixin to class.
    @param headers: {string[]} list of strings that represent an ordered dict key to '__init__' arg mapping.
    @return: {function} decorator that will create a subclass of the decorated class and DataObjectMixin
Severity: Minor
Found in src/main/pyplus/data.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 dataobjects has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def dataobjects(data_object_class):
    """
    Class decorator to mixin DataObjectsMixin to class.
    @param data_object_class: {type} Subclass of DataObjectMixin.
    @return: {function} decorator that will create a subclass of the decorated class and DataObjectsMixin
Severity: Minor
Found in src/main/pyplus/data.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_bool has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def __parse_bool(string, errors=False):
    lower_string = str(string).lower()

    if lower_string == "true":
        return True
Severity: Minor
Found in src/main/pyplus/parse.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 _list2table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _list2table(list_):
    keys, rows = [], []

    for item in list_:
        for key in item:
Severity: Minor
Found in src/main/pyplus/table.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