kuasha/cosmos

View on GitHub

Showing 4,804 of 7,770 total issues

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

    def delete(self, object_path):
        params = object_path.split('/')
        params = list(filter(len, params))
        object_name = params[0]

Severity: Minor
Found in cosmos/service/gridfsservice.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 add_operation_processor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def add_operation_processor(self, processor, object_name, access_types):
        assert isinstance(access_types, collections.Iterable)

        assert len(object_name) > 0

Severity: Minor
Found in cosmos/dataservice/objectservice.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 text_search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def text_search(self, user, object_name, query, columns, limit=5000):
        logging.debug("ObjectService::text_search::{0}".format(object_name))

        allowed_access_type = self.check_access(user, object_name, columns, AccessType.SEARCH, True)

Severity: Minor
Found in cosmos/dataservice/objectservice.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 test_observer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def test_observer(user, object_service, object_name, data, access_type, columns = None, *args, **kwargs):
    assert object_name == "test"
    assert access_type == AccessType.READ or access_type == AccessType.INSERT or access_type == AccessType.UPDATE or access_type == AccessType.DELETE
    logging.info("Test object observer is called with [{}, {}, {}, {}, {}, {}].".format(user, object_service, object_name, data, access_type, columns))

Severity: Minor
Found in samples/barebone/settings.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