Class SudokuAPI
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class SudokuAPI
include Observable
#== Variables d'instances ==
@sudoku
@sudokuCompleted
- Create a ticketCreate a ticket
File SudokuAPI.rb
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
class SudokuAPI
include Observable
#== Variables d'instances ==
@sudoku
@sudokuCompleted
- Create a ticketCreate a ticket
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")
- Read upRead up
- Create a ticketCreate a ticket
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 saveSudoku
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def saveSudoku(fileName)
saveFile = File.new("save_files/"+fileName, "w")
if(!saveFile.closed?)
print "Fichier de sauvegarde ouvert\n"
- Create a ticketCreate a ticket
Method loadSudoku
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def loadSudoku(fileName)
filePath = "save_files/#{fileName}"
if(File.file?(filePath))
loadFile = File.new(filePath, "r")
- Create a ticketCreate a ticket
Method saveSudoku
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def saveSudoku(fileName)
saveFile = File.new("save_files/"+fileName, "w")
if(!saveFile.closed?)
print "Fichier de sauvegarde ouvert\n"
- Read upRead up
- Create a ticketCreate a ticket
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 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)
- Read upRead up
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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"