batebates/sudoku

View on GitHub

Showing 57 of 67 total issues

Method onHover has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def onHover(event, widget)

        lastColor = @caze.color;
        hoverList = [];

Severity: Minor
Found in src/view/SquareView.rb - About 55 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

Method valid? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def valid?()
        if(gridFull()) #Verifie si grille pleine
            for i in 0...9
                if rowValue(i).uniq.length != rowValue(i).length
                    return false
Severity: Minor
Found in src/model/Sudoku.rb - About 45 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

Method rename has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def ProfilManager.rename(oldName, newName)
        if(ProfilManager.existe(oldName) && !ProfilManager.existe(newName))
            @@listeProfil[@@listeProfil.index(oldName)] = newName;
            if(@@dernierPseudo == oldName)
                @@dernierPseudo = newName
Severity: Minor
Found in src/controller/ProfilManager.rb - About 45 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

Method load has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def Config.load()

        if(SudokuAPI.API.username == nil || !File.file?("save_files/"+SudokuAPI.API.username+".yml"))
            return;
        end
Severity: Minor
Found in src/controller/Config.rb - About 45 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

Method render has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def render(squareView, idget, ctx, x, y)
Severity: Minor
Found in src/view/SquareView.rb - About 35 mins to fix

Method showNumber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def showNumber(number)
        for x in 0...9
            for y in 0...9
                candidats = candidateCaze(x,y);
                if(candidats.include?(number) && !cazeAt(x, y).locked)
Severity: Minor
Found in src/controller/SudokuAPI.rb - 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

Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def update(type, data)
        if(type == "hideMenu")
            @menu.name = data ? "rightMenuHidden" : "rightMenu"
            @menu.children.each { |widget|
                if(widget.instance_of?(Gtk::Button))
Severity: Minor
Found in src/view/Menu.rb - 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

Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def update(type, message)
        if(type == "assistant")
            @assistantText.label = "";

            if(@updateTextThread != nil)
Severity: Minor
Found in src/view/AssistantView.rb - 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

Method supprimer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def ProfilManager.supprimer(pseudo)
        if(ProfilManager.existe(pseudo) && pseudo != @@dernierPseudo)
            @@listeProfil.delete_at(@@listeProfil.index(pseudo))
            ProfilManager.save()

Severity: Minor
Found in src/controller/ProfilManager.rb - 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

Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def update(type, data)
        if(type == "hideMenu")
            @hintPanel.name = data ? "hintPanelHidden" : "hintPanel"
            @hintPanel.children.each { |widget|
                if(widget.instance_of?(Gtk::Button))
Severity: Minor
Found in src/view/Window.rb - 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

Avoid too many return statements within this method.
Open

        return true
Severity: Major
Found in src/model/Sudoku.rb - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return !has_duplicates()
Severity: Major
Found in src/model/Generator.rb - About 30 mins to fix

Method onSudokuMethod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def onSudokuMethod
        @type = "onSudokuMethod"
        if(@step==nil)
            @step = 0
            statutMethod(true)
Severity: Minor
Found in src/controller/MethodTwinsAndTriplets.rb - 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

Method onTextEdit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def onTextEdit(nameEntry, nameError, buttonConfirm)
        result = true;
        if(nameEntry.text.length < 3)
            nameError.label = "Nom trop court !";
            result = false;
Severity: Minor
Found in src/view/RegisterView.rb - 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

Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize(parent)
        SudokuAPI.API.add_observer(self);
        myGenerator = nil

        bNewGrid = createButton("grid.png", "Nouvelle partie");
Severity: Minor
Found in src/view/Menu.rb - 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

Method lockSudoku has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def lockSudoku()
        for i in 0...9
            for j in 0...9
                if(@sudokuStart.hasValue?(i,j))
                    @sudoku.cazeAt(i,j).locked=true
Severity: Minor
Found in src/controller/SudokuAPI.rb - 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

Method onSudokuMethod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def onSudokuMethod
        @type = "onSudokuMethod"
        case @step
            when nil
                @step = 0
Severity: Minor
Found in src/controller/MethodUnicite.rb - 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