batebates/sudoku

View on GitHub

Showing 67 of 67 total issues

Class SudokuAPI has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

class SudokuAPI
    include Observable
#== Variables d'instances ==
    @sudoku
    @sudokuCompleted
Severity: Minor
Found in src/controller/SudokuAPI.rb - About 4 hrs to fix

Method initialize has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize()
        SudokuAPI.API.timerPaused = true;
        dialog = Gtk::Dialog.new(:parent => Window.window(), :title => "Utilisateurs", :flags => [:modal, :destroy_with_parent], :buttons => [["_OK", :ok]]);
        dialog.resizable = false;
        dialog.decorated = false;
Severity: Major
Found in src/view/UserDialog.rb - About 4 hrs to fix

Class Generator has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

class Generator

    @grid = []            #avec trou
    @gridPlayer = []    #completé par le jouer
    @gridCorrect = []    #sans trou
Severity: Minor
Found in src/model/Generator.rb - About 3 hrs to fix

File SudokuAPI.rb has 296 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class SudokuAPI
    include Observable
#== Variables d'instances ==
    @sudoku
    @sudokuCompleted
Severity: Minor
Found in src/controller/SudokuAPI.rb - About 3 hrs to fix

Method initialize has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize(newGame)
        @avatarList = Dir[AssetManager.assetsDir() + "/avatar_big/*.png"];
        @avatarIndex = 0;

        window = Window.window();
Severity: Major
Found in src/view/RegisterView.rb - About 3 hrs to fix

Method initialize has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        bNewGrid = createButton("grid.png", "Nouvelle partie");
Severity: Major
Found in src/view/Menu.rb - About 2 hrs to fix

Method render has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def render(squareView, idget, ctx, x, y)

        #White background
        setColor(ctx, @caze.color);
        ctx.rectangle(0, 0, @@size, @@size);
Severity: Minor
Found in src/view/SquareView.rb - About 2 hrs 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 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def render(squareView, idget, ctx, x, y)

        #White background
        setColor(ctx, @caze.color);
        ctx.rectangle(0, 0, @@size, @@size);
Severity: Major
Found in src/view/SquareView.rb - About 2 hrs to fix

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

    def initialize(difficulty, grid_string = "")
        puts "Generating new sudoku..."
        # Either take a pre-created puzzle, or create a new one programmatically

        random = Random.new
Severity: Minor
Found in src/model/Generator.rb - About 2 hrs 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 solve! has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def solve!
        unchanged = false
        imin = nil
        pmin = []
        min = 10
Severity: Minor
Found in src/model/Generator.rb - About 2 hrs 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 show has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def OverlayManager.show()
        @@open = true;
        square = SquareView.selectedSquareView();
        caze = SquareView.selectedSquareView().caze;
        OverlayManager.clear();
Severity: Minor
Found in src/view/OverlayManager.rb - About 2 hrs 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 createEntry has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def createEntry(modConf)
        hBox = Gtk::Box.new(:horizontal, 2)
        #css
        hBox.name = "configEntry"
        #css
Severity: Minor
Found in src/view/ConfigDialog.rb - About 2 hrs to fix

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

    def initialize()
        SudokuAPI.API.timerPaused = true;
        dialog = Gtk::Dialog.new(:parent => Window.window(), :title => "Utilisateurs", :flags => [:modal, :destroy_with_parent], :buttons => [["_OK", :ok]]);
        dialog.resizable = false;
        dialog.decorated = false;
Severity: Minor
Found in src/view/UserDialog.rb - 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

Method dessiner has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def dessiner cr

        ## TODO: Définir une largeur de case et fenêtre par défaut chargé
        ## à partir d'un fichier de config en variables d'instances
        @largeurCase = (25 * toplevel.allocated_width  / 600).round
Severity: Minor
Found in widgetTestGTK3.rb - About 1 hr to fix

Method initialize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize(overlay)
        @@buttons = Array.new();
        @@overlayPanel = Gtk::Fixed.new();
        sudokuChoiceGrid = Gtk::Grid.new();
        sudokuChoiceGrid.name = "overlay-grid";
Severity: Minor
Found in src/view/OverlayManager.rb - About 1 hr to fix

Method solve! has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def solve!
        unchanged = false
        imin = nil
        pmin = []
        min = 10
Severity: Minor
Found in src/model/Generator.rb - About 1 hr to fix

Method demoMethod has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def demoMethod()
    @type = "demoMethod"
    case @step
      when nil
        @step = 0
Severity: Minor
Found in src/controller/MethodCrossReduce.rb - About 1 hr to fix

Method onSudokuMethod has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def onSudokuMethod()
    if @cazeonSudokuMethod == nil
      @cazeonSudokuMethod = firstCazeValue0()
    end
    @type = "onSudokuMethod"
Severity: Minor
Found in src/controller/MethodCrossReduce.rb - About 1 hr to fix

Method loadSudoku has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def loadSudoku(fileName)
        filePath = "save_files/#{fileName}"
        if(File.file?(filePath))
            loadFile = File.new(filePath, "r")

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

Method onSudokuMethod has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def onSudokuMethod


        if(@step == nil)
            statutMethod(true)
Severity: Minor
Found in src/controller/MethodUniqueCandidate.rb - About 1 hr to fix
Severity
Category
Status
Source
Language