Ousret/Picross-L3S6

View on GitHub
class/grille.class.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Class has too many lines. [182/100]
Open

class  Grille<ActiveRecord::Base

    # la Classe Grille permet d'encapsuler une matrice de boolean et de lui ajouter des fonctionnalitées
    # class qui renvoi une grille jouable à partir d'une matrice de boolean
    # cette classe ne gère que les matrice carre
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [21/10]
Open

    def afficher(mat)
        x=0
        #affichache de la grille du haut
        print("---------------------------affichache de la grille du haut---------------------------\n")
        while x < @indicesHaut.length
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [19/10]
Open

    def calculeIndiceHaut()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        y=0
        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [19/10]
Open

    def calculeIndiceCote()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        x=0
        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for initialize is too high. [21.93/15]
Open

    def initialize(matrice)#:nodoc:

        super()

        #gestion des erreur a la  construction de l'objet grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for afficher is too high. [20.35/15]
Open

    def afficher(mat)
        x=0
        #affichache de la grille du haut
        print("---------------------------affichache de la grille du haut---------------------------\n")
        while x < @indicesHaut.length
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [14/10]
Open

    def initialize(matrice)#:nodoc:

        super()

        #gestion des erreur a la  construction de l'objet grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for calculeIndiceHaut is too high. [17.75/15]
Open

    def calculeIndiceHaut()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        y=0
        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [12/10]
Open

    def sauver()
        if(self.new_record?)
            self.matriceComparaisonBD = Marshal.dump(@matriceComparaison)
            self.indicesHautBD        = Marshal.dump(@indicesHaut)
            self.indicesCoteBD        = Marshal.dump(@indicesCote)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for calculeIndiceCote is too high. [17.75/15]
Open

    def calculeIndiceCote()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        x=0
        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [11/10]
Open

    def demanderAide()
        while y < @matriceComparaison.length
            x=0
            while x < @matriceComparaison.length
                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for estNoir? is too high. [15.26/15]
Open

    def estNoir?(x,y)
        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
        y=y-1
        if x > matriceComparaison.length
            raise RangeError.new("coordonée x en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for demanderAide is too high. [15.39/15]
Open

    def demanderAide()
        while y < @matriceComparaison.length
            x=0
            while x < @matriceComparaison.length
                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for eql is too high. [15.52/15]
Open

    def eql(g)
        return (g.id                    == self.id                  and
        g.matriceComparaison    == self.matriceComparaison  and
        g.indicesHaut           == self.indicesHaut         and
        g.indicesCote           == self.indicesCote         and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

    def calculeIndiceHaut()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        y=0
        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Minor
Found in class/grille.class.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 calculeIndiceCote has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def calculeIndiceCote()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        x=0
        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Minor
Found in class/grille.class.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 demanderAide has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def demanderAide()
        while y < @matriceComparaison.length
            x=0
            while x < @matriceComparaison.length
                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def calculeIndiceCote()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        x=0
        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Major
Found in class/grille.class.rb and 1 other location - About 1 hr to fix
class/grille.class.rb on lines 138..160

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 64.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def calculeIndiceHaut()

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
        y=0
        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Major
Found in class/grille.class.rb and 1 other location - About 1 hr to fix
class/grille.class.rb on lines 108..130

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 64.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def eql(g)
        return (g.id                    == self.id                  and
        g.matriceComparaison    == self.matriceComparaison  and
        g.indicesHaut           == self.indicesHaut         and
        g.indicesCote           == self.indicesCote         and
Severity: Minor
Found in class/grille.class.rb and 1 other location - About 30 mins to fix
class/profile.class.rb on lines 81..82

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 32.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Unnecessary spacing detected.
Open

        else                        #si non si la case selectionné est corecte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

    private_class_method :new
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            print(@indicesHaut[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            self.matriceComparaisonBD = Marshal.dump(@matriceComparaison)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #@chrono                #compte le temp passé sur la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #private_class_method :calculeIndiceCote ,:calculeIndiceHaut
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space after keyword if is missing.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Surrounding space missing for operator +=.
Open

                y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Use empty lines between method definitions.
Open

    def terminer?()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Extra blank line detected.
Open



Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Extra blank line detected.
Open


    #=== Methode qui permet d'afficher une grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Unnecessary spacing detected.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

            raise TypeError.new("Grille:initialize : la matrice recu n'est pas carré")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                    @indicesCote[x].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        grille =  Grille.find_by_id(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

        else                        #si non si la case selectionné est corecte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator +=.
Open

                x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator -.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Extra empty line detected at method body end.
Open


    end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Use 2 (not 1) spaces for indentation.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                if(@matriceComparaison[x][y] == 1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

        #gestion des erreur a la  construction de l'objet grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        #affichage de la grille du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space inside parentheses detected.
Open

        g.nbErreur              == self.nbErreur  )
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

    #@matriceComparaison    #matrice de comparaison ,on y coche aucune case
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode  permetant de calculer le score
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    #@matriceDeJeu[x][y] = 1  #on noirsi la premierre bonne case trouvé
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        #affichage de la matrice
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        if x > matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>y</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Return :
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra empty line detected at method body beginning.
Open


        super()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Extra empty line detected at method body end.
Open


    end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Unnecessary spacing detected.
Open

            return false            #on retourne false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

        @score = 1000 - (@nbErreur * 100)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            print(mat[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            raise RangeError.new("coordonée y en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        #@chrono         = Chrono.creer()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>pas de parametre</b>  :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>pas de paramètres</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator +=.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Operator => should be surrounded by a single space.
Open

        :matriceDeJeuBD  => Marshal.dump(self.matriceDeJeu),
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Operator == should be surrounded by a single space.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space missing to the left of {.
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that block braces have or don't have a space before the opening brace depending on configuration.

Example:

# bad
foo.map{ |a|
  a.bar.to_s
}

# good
foo.map { |a|
  a.bar.to_s
}

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Tab detected.
Open

    # la Classe Grille permet d'encapsuler une matrice de boolean et de lui ajouter des fonctionnalitées
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    # cette classe ne gère que les matrice carre
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            while (y < @matriceComparaison.length) #----------------------------------colonne par colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        y=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>x</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        y=y-1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            raise RangeError.new("coordonée y en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

Use empty lines between method definitions.
Open

    def estNoir?(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Use empty lines between method definitions.
Open

    def Grille.charger(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Extra blank line detected.
Open


    #=== Methode qui permet de savoir si la grille est terminé
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Unnecessary spacing detected.
Open

        @indicesHaut     = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Unnecessary spacing detected.
Open

            self.tempBD                  = nil
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

            raise TypeError.new("Grille:initialize : la matrice recu est vide")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        if(self.new_record?)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #<b>pro</b> : profile à comparer
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space after keyword if is missing.
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Surrounding space missing for operator <.
Open

class  Grille<ActiveRecord::Base
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

            y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator -.
Open

        y=y-1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space inside parentheses detected.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

        @score = 1000 - (@nbErreur * 100)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    @indicesCote[x].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Incorrect indentation detected (column 5 instead of 6).
Open

                    #p.argent = p.argent - 10 #chaque demande d'aide coute 10
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks the indentation of comments.

Example:

# bad
  # comment here
def method_name
end

  # comment here
a = 'hello'

# yet another comment
  if true
    true
  end

# good
# comment here
def method_name
end

# comment here
a = 'hello'

# yet another comment
if true
  true
end

Use empty lines between method definitions.
Open

    def Grille.grille(matrice)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Extra blank line detected.
Open


    #=== Methode de classe permetant l'initialisation de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use empty lines between method definitions.
Open

    def calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Unnecessary spacing detected.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Extra blank line detected.
Open


    #=== Methode permetant de mettre a jour un profile modifié dans la BDA
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Unnecessary spacing detected.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

        while y < @matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Unnecessary spacing detected.
Open

        g.nbErreur              == self.nbErreur  )
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

            print(@indicesCote[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        Grille.update(self.id,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            raise RangeError.new("coordonée x en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        #affichache de la grille du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Use 2 (not 1) spaces for indentation.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #return true si la case [x][y] est noir si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Use 2 (not 1) spaces for indentation.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>x</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>y</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #<b>pseudo</b> : pseudo du profile a charger
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space missing after comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space after keyword if is missing.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Space missing after comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator +=.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

                x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator ==.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Operator = should be surrounded by a single space.
Open

        grille =  Grille.find_by_id(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Operator => should be surrounded by a single space.
Open

        :tempBD  => nil,
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space inside parentheses detected.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

    #@indicesCote            #indices logique du coté de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    # class qui renvoi une grille jouable à partir d'une matrice de boolean
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #la methode new() est private pour cette classe
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @nbErreur        = 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #============================
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        #@chrono         = Chrono.creer()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            raise TypeError.new("Grille:initialize : la matrice recu n'est pas carré")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>matrice</b>  : matrice de jeu
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def Grille.grille(matrice)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @indicesHaut     = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>pas de parametre</b>  :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while y < @matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra blank line detected.
Open


    #=== Methode de classe permetant de charger un profile
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use 2 (not 1) spaces for indentation.
Open

                @indicesCote[x].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #@matriceComparaison    #matrice de comparaison ,on y coche aucune case
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #@score                    #le score obtenu sur la grille (=0 t'en que la grille n'est pas terminer)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space after keyword if is missing.
Open

                if(@matriceComparaison[x][y] == 1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Space after keyword elsif is missing.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Space after keyword if is missing.
Open

        if(self.new_record?)
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Surrounding space missing for operator +=.
Open

            y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Tab detected.
Open

    #@chrono                #compte le temp passé sur la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def initialize(matrice)#:nodoc:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        elsif matrice.length != matrice[0].length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @score            = 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    @indicesHaut[y].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        print("---------------------------affichache de la grille du haut---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        print("---------------------------affichage de la matrice---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        if(self.new_record?)
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra empty line detected at class body end.
Open


end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Unnecessary spacing detected.
Open

        grille.chrono                = nil
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Missing space after #.
Open

    #* <b>matrice</b>  : matrice de jeu
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

            @nbErreur += 1             #on incremente le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #return true si la grille est terminé(toutes les bonnes cases ont été noirsi) si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space missing after comma.
Open

    def estNoir?(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator =.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator +=.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        y=y-1
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator -.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Tab detected.
Open

    #@matriceDeJeu          #matrice sur laquelle le joueur interagit
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        new(matrice)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #cette ligne doit resté en commentaire durant le devellopement
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            print(@indicesHaut[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            return false            #on retourne false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def terminer?()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #<b>profile</b> : profile à sauver
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra empty line detected at method body end.
Open


    end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Extra empty line detected at method body end.
Open


    end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Extra blank line detected.
Open


    #=== Methode qui permet de calculer les indices logique du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use 2 (not 1) spaces for indentation.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            if (@matriceComparaison[x] != @matriceDeJeu[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

            #print("\n longeur : "+matrice.length.to_s+" largeur : "+matrice[0].length.to_s+"\n");
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #<b>un profile ne peut pas ètre mis ajour s'il n'a jamais été sauver</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator ==.
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

        :matriceComparaisonBD => Marshal.dump(self.matriceComparaison) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Tab detected.
Open

    #=== Methode de classe permetant l'initialisation de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            while x < @matriceComparaison.length #----------------------------------ligne par ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet de noircire une case
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Return :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while x < @matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        terminer()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.scoreBD              = @score
Severity: Minor
Found in class/grille.class.rb by rubocop

Align the parameters of a method call if they span more than one line.
Open

        :matriceComparaisonBD => Marshal.dump(self.matriceComparaison) ,
        :indicesHautBD => Marshal.dump(self.indicesHaut) ,
        :indicesCoteBD => Marshal.dump(self.indicesCote),
        :matriceDeJeuBD  => Marshal.dump(self.matriceDeJeu),
        :tempBD  => nil,
Severity: Minor
Found in class/grille.class.rb by rubocop

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Use empty lines between method definitions.
Open

    def mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Extra empty line detected at class body beginning.
Open


    # la Classe Grille permet d'encapsuler une matrice de boolean et de lui ajouter des fonctionnalitées
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Extra empty line detected at method body end.
Open


    end
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Unnecessary spacing detected.
Open

class  Grille<ActiveRecord::Base
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            @nbErreur += 1             #on incremente le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

                    #p.argent = p.argent - 10 #chaque demande d'aide coute 10
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #cette ligne doit resté en commentaire durant le devellopement
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space missing after comma.
Open

    def noirsirCase(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator ==.
Open

        if matrice==nil
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

            y=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Surrounding space missing for operator =.
Open

        y=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space found before comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Tab detected.
Open

        @indicesCote    = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        else                        #si non si la case selectionné est corecte
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def terminer()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.save
Severity: Minor
Found in class/grille.class.rb by rubocop

Unnecessary spacing detected.
Open

        @score            = 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

                    return [x, y]
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #@nbErreur              #compte le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Operator => should be surrounded by a single space.
Open

        :nbErreurBD  => self.nbErreur)
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Tab detected.
Open

    #@indicesHaut            #indices logique du haut de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                if(@matriceComparaison[x][y] == 1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                @indicesHaut[y].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            print("\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        #affichage de la grille du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode de classe permetant de charger un profile
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra empty line detected at method body beginning.
Open


        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Unnecessary spacing detected.
Open

            return true                    #retourn true
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Unnecessary spacing detected.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

            y=0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                return false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #la methode new() est private pour cette classe
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>pas de parametre</b>  :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

                    #@matriceDeJeu[x][y] = 1  #on noirsi la premierre bonne case trouvé
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #return true si la case [x][y] été noir si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #<b>return le profile s'il a été trouver si non nil </b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space missing after comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space missing after comma.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Surrounding space missing for operator +=.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space inside parentheses detected.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

    #@score                    #le score obtenu sur la grille (=0 t'en que la grille n'est pas terminer)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    private_class_method :new
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        #gestion des erreur a la  construction de l'objet grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @matriceComparaison    = matrice
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>pas de parametre</b>  :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        #affichache de la grille du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            print("\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def estNoir?(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        return true
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :matriceComparaisonBD => Marshal.dump(self.matriceComparaison) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :scoreBD  => self.score,
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        g.nbErreur              == self.nbErreur  )
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [97/80]
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [83/80]
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [111/80]
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [90/80]
Open

            while x < @matriceComparaison.length #----------------------------------ligne par ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [97/80]
Open

        print("---------------------------affichage de la grille du coté---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra blank line detected.
Open



Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Extra blank line detected.
Open


    #=== Methode qui permet de savoir si une case est noir
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Missing space after #.
Open

    #@indicesHaut            #indices logique du haut de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

            return true                    #retourn true
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Put a space before an end-of-line comment.
Open

    def initialize(matrice)#:nodoc:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for missing space between a token and a comment on the same line.

Example:

# bad
1 + 1# this operation does ...

# good
1 + 1 # this operation does ...

Tab detected.
Open

    #=== Variables d'instance ===
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        if matrice==nil
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            #print("\n longeur : "+matrice.length.to_s+" largeur : "+matrice[0].length.to_s+"\n");
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def demanderAide()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet de calculer les indices logique du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                y+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Unnecessary spacing detected.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Tab detected.
Open

    #=== Methode qui permet de calculer les indices logique du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Use 2 (not 1) spaces for indentation.
Open

        super()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

                    @indicesHaut[y].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Tab detected.
Open

                x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Use 2 (not 1) spaces for indentation.
Open

                @indicesHaut[y].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Tab detected.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use 2 (not 1) spaces for indentation.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #@matriceDeJeu          #matrice sur laquelle le joueur interagit
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Tab detected.
Open

            print(@indicesCote[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

Space after keyword elsif is missing.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Space after keyword if is missing.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks the spacing around the keywords.

Example:

# bad
something 'test'do|x|
end

while(something)
end

something = 123if test

# good
something 'test' do |x|
end

while (something)
end

something = 123 if test

Tab detected.
Open

            raise RangeError.new("coordonée x en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

Surrounding space missing for operator =.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Surrounding space missing for operator -.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Tab detected.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Space found before comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Tab detected.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

Space missing inside }.
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

Example: EnforcedStyle: space (default)

# The `space` style enforces that block braces have
# surrounding space.

# bad
some_array.each {puts e}

# good
some_array.each { puts e }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that block braces don't
# have surrounding space.

# bad
some_array.each { puts e }

# good
some_array.each {puts e}

Example: EnforcedStyleForEmptyBraces: no_space (default)

# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# block braces don't have a space in between when empty.

# bad
some_array.each {   }
some_array.each {  }
some_array.each { }

# good
some_array.each {}

Example: EnforcedStyleForEmptyBraces: space

# The `space` EnforcedStyleForEmptyBraces style enforces that
# block braces have at least a spece in between when empty.

# bad
some_array.each {}

# good
some_array.each { }
some_array.each {  }
some_array.each {   }

Example: SpaceBeforeBlockParameters: true (default)

# The SpaceBeforeBlockParameters style set to `true` enforces that
# there is a space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each {|n| n * 2 }

# good
[1, 2, 3].each { |n| n * 2 }

Example: SpaceBeforeBlockParameters: true

# The SpaceBeforeBlockParameters style set to `false` enforces that
# there is no space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each { |n| n * 2 }

# good
[1, 2, 3].each {|n| n * 2 }

Space inside parentheses detected.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        self.calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    return [x, y]
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet d'afficher une grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>pas de paramètres</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            print("\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Return :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        return @matriceComparaison[x][y] == 1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def noirsirCase(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            @nbErreur += 1             #on incremente le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            if (@matriceComparaison[x] != @matriceDeJeu[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        else
Severity: Minor
Found in class/grille.class.rb by rubocop

Extra empty line detected at method body beginning.
Open


        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Extra empty line detected at method body beginning.
Open


        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks if empty lines exist around the bodies of methods.

Example:

# good

def foo
  # ...
end

# bad

def bar

  # ...

end

Unnecessary spacing detected.
Open

            @nbErreur += 1             #on incremente le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Unnecessary spacing detected.
Open

        grille =  Grille.find_by_id(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Use 2 (not 1) spaces for indentation.
Open

        new(matrice)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Use 2 (not 1) spaces for indentation.
Open

        @matriceDeJeu = uneMatriceCible
Severity: Minor
Found in class/grille.class.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Missing space after #.
Open

    #@indicesCote            #indices logique du coté de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

        #affichage de la matrice
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

            return false            #on retourne false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Missing space after #.
Open

    #<b>profile</b> : profile à sauver
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Operator => should be surrounded by a single space.
Open

        :scoreBD  => self.score,
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

        :indicesHautBD => Marshal.dump(self.indicesHaut) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space inside parentheses detected.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

    #@nbErreur              #compte le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            while x < @matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            y=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                @indicesCote[x].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #return true si la case [x][y] été noir si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x+=1
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :tempBD  => nil,
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #<b>pro</b> : profile à comparer
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [116/80]
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Use only ascii symbols in comments.
Open

    # class qui renvoi une grille jouable à partir d'une matrice de boolean
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

                    #@matriceDeJeu[x][y] = 1  #on noirsi la premierre bonne case trouvé
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Tab detected.
Open

        super()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        self.calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode  permetant de demander de l'aide
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    #p.argent = p.argent - 10 #chaque demande d'aide coute 10
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def afficher(mat)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #return true si la grille est terminé(toutes les bonnes cases ont été noirsi) si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                return false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.matriceComparaisonBD = Marshal.dump(@matriceComparaison)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.tempBD                  = nil
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        grille.matriceDeJeu        = Marshal.load(grille.matriceDeJeuBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        g.indicesCote           == self.indicesCote         and
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [136/80]
Open

                @indicesCote[x].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [136/80]
Open

                    @indicesHaut[y].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [111/80]
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #@chrono                #compte le temp passé sur la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #<b>profile</b> : profile à sauver
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

            if (@matriceComparaison[x] != @matriceDeJeu[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

Example:

# bad
if condition
  do_stuff(bar)
end

unless qux.empty?
  Foo.do_something
end

# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?

Provide an exception class and message as arguments to raise.
Open

            raise RangeError.new("coordonée x en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Redundant return detected.
Open

        return grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant self detected.
Open

        :matriceDeJeuBD  => Marshal.dump(self.matriceDeJeu),
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Redundant self detected.
Open

        :nbErreurBD  => self.nbErreur)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Avoid using Marshal.load.
Open

        grille.matriceComparaison  = Marshal.load(grille.matriceComparaisonBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.

Example:

# bad
Marshal.load("{}")
Marshal.restore("{}")

# good
Marshal.dump("{}")

# okish - deep copy hack
Marshal.load(Marshal.dump({}))

Avoid using Marshal.load.
Open

        grille.indicesCote         = Marshal.load(grille.indicesCoteBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.

Example:

# bad
Marshal.load("{}")
Marshal.restore("{}")

# good
Marshal.dump("{}")

# okish - deep copy hack
Marshal.load(Marshal.dump({}))

Operator and should be surrounded by a single space.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that operators have space around them, except for ** which should not have surrounding space.

Example:

# bad
total = 3*4
"apple"+"juice"
my_number = 38/4
a ** b

# good
total = 3 * 4
"apple" + "juice"
my_number = 38 / 4
a**b

Space found before comma.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space found before comma.
Open

    attr_writer :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for comma (,) preceded by space.

Example:

# bad
[1 , 2 , 3]
a(1 , 2)
each { |a , b| }

# good
[1, 2, 3]
a(1, 2)
each { |a, b| }

Space missing inside {.
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

Example: EnforcedStyle: space (default)

# The `space` style enforces that block braces have
# surrounding space.

# bad
some_array.each {puts e}

# good
some_array.each { puts e }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that block braces don't
# have surrounding space.

# bad
some_array.each { puts e }

# good
some_array.each {puts e}

Example: EnforcedStyleForEmptyBraces: no_space (default)

# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# block braces don't have a space in between when empty.

# bad
some_array.each {   }
some_array.each {  }
some_array.each { }

# good
some_array.each {}

Example: EnforcedStyleForEmptyBraces: space

# The `space` EnforcedStyleForEmptyBraces style enforces that
# block braces have at least a spece in between when empty.

# bad
some_array.each {}

# good
some_array.each { }
some_array.each {  }
some_array.each {   }

Example: SpaceBeforeBlockParameters: true (default)

# The SpaceBeforeBlockParameters style set to `true` enforces that
# there is a space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each {|n| n * 2 }

# good
[1, 2, 3].each { |n| n * 2 }

Example: SpaceBeforeBlockParameters: true

# The SpaceBeforeBlockParameters style set to `false` enforces that
# there is no space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each { |n| n * 2 }

# good
[1, 2, 3].each {|n| n * 2 }

Tab detected.
Open

            raise TypeError.new("Grille:initialize : la matrice recu est vide")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #private_class_method :calculeIndiceCote ,:calculeIndiceHaut
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while x < mat.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while x < @indicesCote.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode de classe permetant de sauver un profile
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.indicesCoteBD        = Marshal.dump(@indicesCote)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        grille =  Grille.find_by_id(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :indicesCoteBD => Marshal.dump(self.indicesCote),
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [121/80]
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use && instead of and.
Open

        g.indicesCote           == self.indicesCote         and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Use only ascii symbols in comments.
Open

                @indicesCote[x].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def terminer?()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Do not use parentheses for method calls with no arguments.
Open

        @indicesHaut     = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Do not use parentheses for method calls with no arguments.
Open

        terminer()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Do not use parentheses for method calls with no arguments.
Open

            mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Redundant self detected.
Open

        self.calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Tab detected.
Open

        return [-1, -1]
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        while x < @indicesHaut.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        print("---------------------------affichage de la grille du coté---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet de savoir si une case est noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #return true si la case [x][y] est noir si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            return true                    #retourn true
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #<b>pseudo</b> : pseudo du profile a charger
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        return grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :indicesHautBD => Marshal.dump(self.indicesHaut) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [111/80]
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for method names.
Open

    def calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use snake_case for method names.
Open

    def demanderAide()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use snake_case for variable names.
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use && instead of and.
Open

        g.indicesHaut           == self.indicesHaut         and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Use only ascii symbols in comments.
Open

                    @indicesCote[x].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Do not use parentheses for method calls with no arguments.
Open

        calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Redundant self detected.
Open

            self.save
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        x=0
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            print(mat[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        if y > matriceComparaison.length
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet de savoir si la grille est terminé
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def sauver()
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [105/80]
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [111/80]
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        @indicesHaut     = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #return true si la case [x][y] été noir si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use (@matriceDeJeu[x][y]).zero? instead of @matriceDeJeu[x][y] == 0.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

Example: EnforcedStyle: predicate (default)

# bad

foo == 0
0 > foo
bar.baz > 0

# good

foo.zero?
foo.negative?
bar.baz.positive?

Example: EnforcedStyle: comparison

# bad

foo.zero?
foo.negative?
bar.baz.positive?

# good

foo == 0
0 > foo
bar.baz > 0

Don't use parentheses around the condition of a while.
Open

            while (y < @matriceComparaison.length) #----------------------------------colonne par colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the presence of superfluous parentheses around the condition of if/unless/while/until.

Example:

# bad
x += 1 while (x < 10)
foo unless (bar || baz)

if (x > 10)
elsif (x < 3)
end

# good
x += 1 while x < 10
foo unless bar || baz

if x > 10
elsif x < 3
end

Redundant return detected.
Open

            return false            #on retourne false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant self detected.
Open

        Grille.update(self.id,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Redundant self detected.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Redundant self detected.
Open

        g.indicesHaut           == self.indicesHaut         and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Tab detected.
Open

    def calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.indicesHautBD        = Marshal.dump(@indicesHaut)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        grille.nbErreur            = grille.nbErreurBD
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [96/80]
Open

            while (y < @matriceComparaison.length) #----------------------------------colonne par colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [91/80]
Open

    #return true si la grille est terminé(toutes les bonnes cases ont été noirsi) si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

            self.matriceDeJeuBD       = Marshal.dump(@matriceDeJeu)
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        @indicesCote    = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Tab detected.
Open

        grille.indicesHaut         = Marshal.load(grille.indicesHautBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Tab detected.
Open

        grille.chrono                = nil
Severity: Minor
Found in class/grille.class.rb by rubocop

Use only ascii symbols in comments.
Open

        #affichage de la grille du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Line is too long. [155/80]
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Missing top-level class documentation comment.
Open

class  Grille<ActiveRecord::Base
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Line is too long. [136/80]
Open

                @indicesHaut[y].push(nbCaseNoirConsecutif) #-------------------on rajoute le nombre de case noir dans le tableau des indices du haut
Severity: Minor
Found in class/grille.class.rb by rubocop

Use only ascii symbols in comments.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use array literal [] instead of Array.new.
Open

        @indicesCote    = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

Example:

# bad
a = Array.new
h = Hash.new
s = String.new

# good
a = []
h = {}
s = ''

Use the new Ruby 1.9 hash syntax.
Open

        :matriceDeJeuBD  => Marshal.dump(self.matriceDeJeu),
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in class/grille.class.rb by rubocop

Provide an exception class and message as arguments to raise.
Open

            raise TypeError.new("Grille:initialize : la matrice recu est vide")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Do not use then for multi-line if.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Redundant self detected.
Open

        self.calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Redundant return detected.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Tab detected.
Open

            end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode qui permet de faire les operation nécessaire à la fin d'une grille
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Note :
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [101/80]
Open

    # la Classe Grille permet d'encapsuler une matrice de boolean et de lui ajouter des fonctionnalitées
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for method names.
Open

    def calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use snake_case for method names.
Open

    def estNoir?(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use only ascii symbols in comments.
Open

    #Définition des methodes d'accèes en lecture
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #* <b>pas de paramètres</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #<b>return le profile s'il a été trouver si non nil </b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use self.charger instead of Grille.charger.
Open

    def Grille.charger(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of the class/module name instead of self, when defining class/module methods.

Example:

# bad
class SomeClass
  def SomeClass.class_method
    # ...
  end
end

# good
class SomeClass
  def self.class_method
    # ...
  end
end

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Use the new Ruby 1.9 hash syntax.
Open

        :tempBD  => nil,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Do not use parentheses for method calls with no arguments.
Open

        @indicesCote    = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Redundant self detected.
Open

        g.nbErreur              == self.nbErreur  )
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Tab detected.
Open

    #===Return:
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        grille.indicesCote         = Marshal.load(grille.indicesCoteBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode permetant de comparer deux profiles
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        g.indicesHaut           == self.indicesHaut         and
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        @matriceDeJeu = uneMatriceCible
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [86/80]
Open

    #@score                    #le score obtenu sur la grille (=0 t'en que la grille n'est pas terminer)
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [121/80]
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for method names.
Open

    def noirsirCase(x,y)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use snake_case for variable names.
Open

            @nbErreur += 1             #on incremente le nombre d'erreur du joueur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #=== Methode qui permet de calculer les indices logique du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

        if estNoir?(x,y)==false        #si la case selectionné n'est pas correcte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Do not use then for multi-line if.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Use self-assignment shorthand -=.
Open

        y=y-1
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop enforces the use the shorthand for self-assignment.

Example:

# bad
x = x + 1

# good
x += 1

Avoid using Marshal.load.
Open

        grille.indicesHaut         = Marshal.load(grille.indicesHautBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.

Example:

# bad
Marshal.load("{}")
Marshal.restore("{}")

# good
Marshal.dump("{}")

# okish - deep copy hack
Marshal.load(Marshal.dump({}))

Tab detected.
Open

    def restorer(uneMatriceCible)
Severity: Minor
Found in class/grille.class.rb by rubocop

Method Grille#nbErreur is defined at both class/grille.class.rb:32 and class/grille.class.rb:32.
Open

    attr_reader :matriceComparaison ,:matriceDeJeu  ,:indicesHaut  ,:indicesCote ,:nbErreur ,:chrono ,:score, :nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end

Line is too long. [83/80]
Open

        nbCaseNoirConsecutif = 0 #variable qui permet de gerer les cases noir consecutifs
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

        @matriceDeJeu = uneMatriceCible
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des ligne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #* <b>pas de paramètre</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

        else                        #si non si la case selectionné est corecte
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #return true si la grille est terminé(toutes les bonnes cases ont été noirsi) si non false
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use the new Ruby 1.9 hash syntax.
Open

        :matriceComparaisonBD => Marshal.dump(self.matriceComparaison) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Prefer the use of the nil? predicate.
Open

        if matrice==nil
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for comparison of something with nil using ==.

Example:

# bad
if x == nil
end

# good
if x.nil?
end

Don't use parentheses around the condition of an if.
Open

            if (@matriceComparaison[x] != @matriceDeJeu[x])
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the presence of superfluous parentheses around the condition of if/unless/while/until.

Example:

# bad
x += 1 while (x < 10)
foo unless (bar || baz)

if (x > 10)
elsif (x < 3)
end

# good
x += 1 while x < 10
foo unless bar || baz

if x > 10
elsif x < 3
end

Redundant self detected.
Open

        :matriceComparaisonBD => Marshal.dump(self.matriceComparaison) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Tab detected.
Open

        end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #<b>return le profile s'il a été trouver si non nil </b>
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        grille.matriceComparaison  = Marshal.load(grille.matriceComparaisonBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        g.matriceComparaison    == self.matriceComparaison  and
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [100/80]
Open

        @matriceDeJeu = Array.new(@matriceComparaison.length, 0){Array.new(@matriceComparaison.length, 0)}
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #* <b>y</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

            @matriceDeJeu[x-1][y-1] = 1     # on noirsi la case selectionné
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Methode permetant de mettre a jour un profile modifié dans la BDA
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Do not use parentheses for method calls with no arguments.
Open

        self.calculeIndiceHaut()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Avoid using Marshal.load.
Open

        grille.matriceDeJeu        = Marshal.load(grille.matriceDeJeuBD)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.

Example:

# bad
Marshal.load("{}")
Marshal.restore("{}")

# good
Marshal.dump("{}")

# okish - deep copy hack
Marshal.load(Marshal.dump({}))

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Tab detected.
Open

        Grille.update(self.id,
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

                nbCaseNoirConsecutif = 0 #-------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Line is too long. [102/80]
Open

        while y < @matriceComparaison.length #------------------------------------on parcours chaque colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [113/80]
Open

                if(@matriceComparaison[x][y] == 1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [85/80]
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

Use only ascii symbols in comments.
Open

    #@indicesCote            #indices logique du coté de la grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use snake_case for method names.
Open

    def calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use only ascii symbols in comments.
Open

                    nbCaseNoirConsecutif = 0 #------------------------------------et on remet le `nbCaseNoirConsecutif` à zero
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use snake_case for variable names.
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #cette ligne doit resté en commentaire durant le devellopement
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use && instead of and.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Use only ascii symbols in comments.
Open

    #* <b>x</b>:coordonée x : la ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use && instead of and.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Use only ascii symbols in comments.
Open

    #=== Methode qui permet de faire les operation nécessaire à la fin d'une grille
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    # cette classe ne gère que les matrice carre
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #<b>pro</b> : profile à comparer
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def calculeScore()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Use self.grille instead of Grille.grille.
Open

    def Grille.grille(matrice)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of the class/module name instead of self, when defining class/module methods.

Example:

# bad
class SomeClass
  def SomeClass.class_method
    # ...
  end
end

# good
class SomeClass
  def self.class_method
    # ...
  end
end

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def terminer()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        if matrice==nil
Severity: Minor
Found in class/grille.class.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Use array literal [] instead of Array.new.
Open

        @indicesHaut     = Array.new(@matriceComparaison.length) { Array.new() }
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

Example:

# bad
a = Array.new
h = Hash.new
s = String.new

# good
a = []
h = {}
s = ''

Use the new Ruby 1.9 hash syntax.
Open

        :nbErreurBD  => self.nbErreur)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Use the new Ruby 1.9 hash syntax.
Open

        :scoreBD  => self.score,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Do not use then for multi-line if.
Open

                if(@matriceComparaison[x][y] == 1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Redundant return detected.
Open

        return @matriceComparaison[x][y] == 1
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant self detected.
Open

        :indicesCoteBD => Marshal.dump(self.indicesCote),
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Do not use then for multi-line if.
Open

                if(@matriceComparaison[x][y] == 1 and @matriceDeJeu[x][y] == 0 ) then
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Do not use then for multi-line if.
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Redundant self detected.
Open

        if(self.new_record?)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

            raise RangeError.new("coordonée x en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Tab detected.
Open

            self.nbErreurBD           = @nbErreur
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    #=== Methode permetant de mettre a jour un profile modifié dans la BDA
Severity: Minor
Found in class/grille.class.rb by rubocop

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def sauver()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Tab detected.
Open

    #<b>un profile ne peut pas ètre mis ajour s'il n'a jamais été sauver</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :matriceDeJeuBD  => Marshal.dump(self.matriceDeJeu),
Severity: Minor
Found in class/grille.class.rb by rubocop

Provide an exception class and message as arguments to raise.
Open

            raise TypeError.new("Grille:initialize : la matrice recu n'est pas carré")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Provide an exception class and message as arguments to raise.
Open

            raise RangeError.new("coordonée y en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Redundant return detected.
Open

            return true                    #retourn true
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant return detected.
Open

        return true
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Line is too long. [136/80]
Open

                    @indicesCote[x].push(nbCaseNoirConsecutif) #------------------on rajoute le nombre de case noir dans le tableau des indices du coté
Severity: Minor
Found in class/grille.class.rb by rubocop

Redundant self detected.
Open

        :indicesHautBD => Marshal.dump(self.indicesHaut) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Line is too long. [105/80]
Open

                    nbCaseNoirConsecutif +=1 #--------------------------------------on incremente `nbCaseNoirConsecutif`
Severity: Minor
Found in class/grille.class.rb by rubocop

Redundant self detected.
Open

        g.indicesCote           == self.indicesCote         and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Line is too long. [98/80]
Open

        print("---------------------------affichache de la grille du haut---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        @matriceComparaison    = matrice
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    # la Classe Grille permet d'encapsuler une matrice de boolean et de lui ajouter des fonctionnalitées
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres :
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Methode qui permet de savoir si la grille est terminé
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Do not use parentheses for method calls with no arguments.
Open

        self.calculeIndiceCote()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for unwanted parentheses in parameterless method calls.

Example:

# bad
object.some_method()

# good
object.some_method

Do not use then for multi-line elsif.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Do not use then for multi-line elsif.
Open

                elsif(nbCaseNoirConsecutif != 0 ) then #-----------------------si non si `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks for uses of the then keyword in multi-line if statements.

Example:

# bad
# This is considered bad practice.
if cond then
end

# good
# If statements can contain `then` on the same line.
if cond then a
elsif cond then b
end

Redundant self detected.
Open

        :scoreBD  => self.score,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

            raise RangeError.new("coordonée y en dehors de la matrice ")
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Tab detected.
Open

    #
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def Grille.charger(id)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        :nbErreurBD  => self.nbErreur)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    def eql(g)
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

        return (g.id                    == self.id                  and
Severity: Minor
Found in class/grille.class.rb by rubocop

Tab detected.
Open

    end
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [89/80]
Open

            #print("\n longeur : "+matrice.length.to_s+" largeur : "+matrice[0].length.to_s+"\n");
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [111/80]
Open

                if(@matriceComparaison[x][y]==1) then #---------------------------------------si on tombe sur une case noir
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [157/80]
Open

            if(nbCaseNoirConsecutif != 0 ) then #---------------------------si on a terminé le parcour des colonne et que `nbCaseNoirConsecutif` est differant de zero
Severity: Minor
Found in class/grille.class.rb by rubocop

Line is too long. [102/80]
Open

        while x < @matriceComparaison.length #--------------------------------------on parcours chaque ligne
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for method names.
Open

    def mettreAJour()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Line is too long. [90/80]
Open

        print("---------------------------affichage de la matrice---------------------------\n")
Severity: Minor
Found in class/grille.class.rb by rubocop

Use snake_case for variable names.
Open

        @nbErreur        = 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use && instead of and.
Open

        g.matriceComparaison    == self.matriceComparaison  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Use snake_case for variable names.
Open

    def restorer(uneMatriceCible)
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use only ascii symbols in comments.
Open

    #* <b>x</b>:coordonée y : la colonne
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #=== Paramètres:
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Use only ascii symbols in comments.
Open

    #<b>un profile ne peut pas ètre mis ajour s'il n'a jamais été sauver</b>
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for non-ascii (non-English) characters in comments. You could set an array of allowed non-ascii chars in AllowedChars attribute (empty by default).

Example:

# bad
# Translates from English to 日本語。

# good
# Translates from English to Japanese

Omit the parentheses in defs when the method doesn't accept any arguments.
Open

    def demanderAide()
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

Example:

# bad
def foo()
  # does a thing
end

# good
def foo
  # does a thing
end

# also good
def foo() does_a_thing end

Example:

# bad
def Baz.foo()
  # does a thing
end

# good
def Baz.foo
  # does a thing
end

Use the new Ruby 1.9 hash syntax.
Open

        :indicesCoteBD => Marshal.dump(self.indicesCote),
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Use the new Ruby 1.9 hash syntax.
Open

        :indicesHautBD => Marshal.dump(self.indicesHaut) ,
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks hash literal syntax.

It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

A separate offense is registered for each problematic pair.

The supported styles are:

  • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
  • hash_rockets - forces use of hash rockets for all hashes
  • nomixedkeys - simply checks for hashes with mixed syntaxes
  • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

Example: EnforcedStyle: ruby19 (default)

# bad
{:a => 2}
{b: 1, :c => 2}

# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden

Example: EnforcedStyle: hash_rockets

# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}

# good
{:a => 1, :b => 2}

Example: EnforcedStyle: nomixedkeys

# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}

# good
{:a => 1, :b => 2}
{c: 1, d: 2}

Example: EnforcedStyle: ruby19nomixed_keys

# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets

# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}

Redundant return detected.
Open

        return [-1, -1]
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Redundant self detected.
Open

        g.matriceComparaison    == self.matriceComparaison  and
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Use self-assignment shorthand -=.
Open

        x=x-1   #on decrémente les indices de -1 parce que le tableau commence à l'indice 0
Severity: Minor
Found in class/grille.class.rb by rubocop

This cop enforces the use the shorthand for self-assignment.

Example:

# bad
x = x + 1

# good
x += 1

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

            raise TypeError.new("Grille:initialize : la matrice recu est vide")
Severity: Minor
Found in class/grille.class.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

There are no issues that match your filters.

Category
Status