AndresMWeber/nomenclate-api

View on GitHub

Showing 3 of 9 total issues

Function render_nomenclate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def render_nomenclate(_id):
    nomenclate = NomenclateModel.find_by_id(_id)
    
    app.nomenclate.format = nomenclate.format or app.nomenclate.format
    cur_state = app.nomenclate.state
Severity: Minor
Found in nomenclateAPI/app.py - About 1 hr 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 patch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def patch(self, _id, **kwargs):
        data = self.parser.parse_args()

        nomenclate = NomenclateModel.find_by_id(_id)

Severity: Minor
Found in nomenclateAPI/resources/nomenclate.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 patch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def patch(self, name):
        data = self.parser.parse_args()
        data['name'] = name
        data['token'] = data.get('token', name)

Severity: Minor
Found in nomenclateAPI/resources/token.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

Severity
Category
Status
Source
Language