Ousret/Picross-L3S6

View on GitHub

Showing 2,952 of 2,952 total issues

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

class Jeu

  FAST_GAME = "Partie rapide"
  ADVENTURE = "Aventure"
  QUIT = "Quitter"
Severity: Minor
Found in main.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.

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.

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

  class Scene < Ray::Scene
    #Partage de variable de classe avec Game
    include Render
    include Observable
    scene_name :stdout
Severity: Minor
Found in class/render.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.

Assignment Branch Condition size for actionOnGame is too high. [69.81/15]
Open

  def actionOnGame(unTypeEvenement, unComposantCible, unTexteEntree=nil)
    # Gestion des événements sur menu principal
    return if unTypeEvenement != 1 # On ne recherche que le clique souris
    btn_cible_libell = unComposantCible.designation

Severity: Minor
Found in main.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. [58/10]
Open

  def initializeGame
    @kInGame.supprimeTout

    background = Image.creer("Background", "ressources/maps/Couloirs-Resized.png", 0, 0, 0)

Severity: Minor
Found in main.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. [53/10]
Open

  def actionOnGame(unTypeEvenement, unComposantCible, unTexteEntree=nil)
    # Gestion des événements sur menu principal
    return if unTypeEvenement != 1 # On ne recherche que le clique souris
    btn_cible_libell = unComposantCible.designation

Severity: Minor
Found in main.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 initializeGame is too high. [55.69/15]
Open

  def initializeGame
    @kInGame.supprimeTout

    background = Image.creer("Background", "ressources/maps/Couloirs-Resized.png", 0, 0, 0)

Severity: Minor
Found in main.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 setup is too high. [53.26/15]
Open

    def setup

      @scene_loops_per_second = 24
      @@vertex = nil

Severity: Minor
Found in class/render.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. [38/10]
Open

    def setup

      @scene_loops_per_second = 24
      @@vertex = nil

Severity: Minor
Found in class/render.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.

File main.rb has 328 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'observer'
require 'json'
require 'curb'

load './class/bmp.class.rb'
Severity: Minor
Found in main.rb - About 3 hrs to fix

    Method actionOnGame has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

      def actionOnGame(unTypeEvenement, unComposantCible, unTexteEntree=nil)
        # Gestion des événements sur menu principal
        return if unTypeEvenement != 1 # On ne recherche que le clique souris
        btn_cible_libell = unComposantCible.designation
    
    
    Severity: Minor
    Found in main.rb - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

      def install
        onlineLevels = fetchOnline
        uneListeNiveau = Dir["ressources/images/imagesPicross/BMP24bitsRVB/*.bmp"].sort
        i = 1
    
    
    Severity: Minor
    Found in main.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 setAnimations is too high. [27.73/15]
    Open

        def setAnimations
          #Boucle de rafraichissement
          always do
            @@contexte.listeComposant.each do |composant|
    
    
    Severity: Minor
    Found in class/render.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. [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.

    Perceived complexity for actionOnGame is too high. [18/7]
    Open

      def actionOnGame(unTypeEvenement, unComposantCible, unTexteEntree=nil)
        # Gestion des événements sur menu principal
        return if unTypeEvenement != 1 # On ne recherche que le clique souris
        btn_cible_libell = unComposantCible.designation
    
    
    Severity: Minor
    Found in main.rb by rubocop

    This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

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

            def read_dib_header(file)
            #méthode qui effectue des tests pour les exceptions :
            #test si l'url est bonne
            #test si l'image est convenable :
            #    l'image doit être codée avec du 24bit par pixel
    Severity: Minor
    Found in class/bmp.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 createSprite is too high. [24.74/15]
    Open

        def createSprite(unComposant)
          @sprite = sprite unComposant.source
          @sprite.sheet_size = [unComposant.dimx, unComposant.dimy] # Dimention du Sprite
          @sprite.sheet_pos = [unComposant.etx, unComposant.ety]
          @sprite.pos = [unComposant.posx, unComposant.posy]
    Severity: Minor
    Found in class/render.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. [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.

    Cyclomatic complexity for actionOnGame is too high. [14/6]
    Open

      def actionOnGame(unTypeEvenement, unComposantCible, unTexteEntree=nil)
        # Gestion des événements sur menu principal
        return if unTypeEvenement != 1 # On ne recherche que le clique souris
        btn_cible_libell = unComposantCible.designation
    
    
    Severity: Minor
    Found in main.rb by rubocop

    This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

    An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

    Severity
    Category
    Status
    Source
    Language