laboiteproject/lenuage

View on GitHub

Showing 384 of 384 total issues

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

    def get_context_data(self, **kwargs):
        context = super(TileUpdateView, self).get_context_data(**kwargs)
        context['boite'] = self.object.boite
        context['boite_id'] = self.object.boite.id

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

    def get_apps_dictionary(self):
        apps_dict = {}
        for model in apps.get_models():
            if issubclass(model, App):
                applications = model.objects.filter(boite=self, enabled=True)
Severity: Minor
Found in boites/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 draw has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function draw(x0, y0, bitmap, width, height, color, bg) {
    for(var y = 0; y <= bitmap.length/height+1; y++) {
        for(var x = 0; x <= width-1; x++) {
            if(bitmap[x+y*width]==1)
                drawPixel(x+x0, y+y0, color);
Severity: Minor
Found in laboite/static/js/gfx.js - 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 drawHex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function drawHex(x0, y0, hex_bitmap, width, height, color, bg) {
    bitmap = hexToBinary(hex_bitmap);
    for(var y = 0; y <= bitmap.length/height+1; y++) {
        for(var x = 0; x <= width-1; x++) {
            if(bitmap[x+y*width]==1)
Severity: Minor
Found in laboite/static/js/gfx.js - 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