gecos-team/gecoscc-ui

View on GitHub

Showing 845 of 1,621 total issues

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

    def __call__(self, node, value):

        super(UpdateScriptRangeValidator, self).__call__(node,value)

        scriptdir = self.decompress + 'scripts'
Severity: Minor
Found in gecoscc/models.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 assertEqualObjects has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def assertEqualObjects(self, data, new_data, schema_data=None,
        schema_new_data=None, fields=None):
        '''
        Useful method, check the second dictionary has the same values than
        the first. The second dictionary could have other attrs
Severity: Minor
Found in gecoscc/tests.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 get_dummy_json_put_request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_dummy_json_put_request(self, data, schema=None, is_superuser=True,
        path=None):
        '''
        Useful method, returns a typical put request
        '''
Severity: Minor
Found in gecoscc/tests.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 data_validated_hook_user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def data_validated_hook_user(self, data):
        for i, comp in enumerate(data.get('computers', [])):
            comp_id = data['computers'][i]
            if isinstance(comp_id, string_types):
                data['computers'][i] = ObjectId(comp_id)
Severity: Minor
Found in gecoscc/tests.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 get_dummy_request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_dummy_request(self, is_superuser=True):
        '''
        Useful method, returns a typical request, with the same request
        properties than pyramid add (see gecoscc/__init__)
        '''
Severity: Minor
Found in gecoscc/tests.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