openSUSE/trollolo

View on GitHub

Showing 41 of 41 total issues

Method show has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def show(board_id, version, options = {})
    out = options[:output] || STDOUT

    backup_path = File.join(@directory, board_id, version)

Severity: Minor
Found in lib/backup.rb - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Method to_hash has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def to_hash
    base = {
      'date' => date_time.to_date.to_s,
      'updated_at' => date_time.to_s,
      'story_points' => {
Severity: Minor
Found in lib/burndown_data.rb - About 1 hr to fix

    Method show has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def show(board_id, version, options = {})
        out = options[:output] || STDOUT
    
        backup_path = File.join(@directory, board_id, version)
    
    
    Severity: Minor
    Found in lib/backup.rb - About 1 hr to fix

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

        def update(options)
          burndown_data_path = load_sprint(options['output'] || Dir.pwd, options[:sprint_number])
      
          @data['meta']['board_id'] = options['board-id'] if options.key?('board-id')
          burndown_data = BurndownData.new(@settings)
      Severity: Minor
      Found in lib/burndown_chart.rb - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function getSprintData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def getSprintData(self, burndown):
          self.sprint_number = burndown["meta"]["sprint"]
          self.weekend_lines = burndown["meta"]["weekend_lines"]
          self.total_days = burndown["meta"]["total_days"]
          self.extra_day = 0
      Severity: Minor
      Found in scripts/burndowndata.py - About 1 hr to fix

        Function draw has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def draw(self, y_label, color, color_unplanned, marker, linestyle, linewidth, label, plot):
        Severity: Major
        Found in scripts/graph.py - About 1 hr to fix

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

              if self.data.unplanned_day:
                story_points['x_unplanned'] = self.data.unplanned_story_points_days
                story_points['y_unplanned'] = self.data.unplanned_story_points_done
          Severity: Major
          Found in scripts/plot.py and 3 other locations - About 1 hr to fix
          scripts/plot.py on lines 97..99
          scripts/plot.py on lines 123..125
          scripts/plot.py on lines 126..128

          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 38.

          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 4 locations. Consider refactoring.
          Open

              if self.data.unplanned_day:
                tasks['x_unplanned'] = self.data.unplanned_tasks_days
                tasks['y_unplanned'] = self.data.unplanned_tasks_done
          Severity: Major
          Found in scripts/plot.py and 3 other locations - About 1 hr to fix
          scripts/plot.py on lines 97..99
          scripts/plot.py on lines 100..102
          scripts/plot.py on lines 123..125

          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 38.

          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 4 locations. Consider refactoring.
          Open

              if self.data.extra_day:
                tasks['x_extra'] = self.data.tasks_extra_days
                tasks['y_extra'] = self.data.bonus_tasks_done
          Severity: Major
          Found in scripts/plot.py and 3 other locations - About 1 hr to fix
          scripts/plot.py on lines 97..99
          scripts/plot.py on lines 100..102
          scripts/plot.py on lines 126..128

          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 38.

          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 4 locations. Consider refactoring.
          Open

              if self.data.extra_day:
                story_points['x_extra'] = self.data.story_points_extra_days
                story_points['y_extra'] = self.data.bonus_story_points_done
          Severity: Major
          Found in scripts/plot.py and 3 other locations - About 1 hr to fix
          scripts/plot.py on lines 100..102
          scripts/plot.py on lines 123..125
          scripts/plot.py on lines 126..128

          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 38.

          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

                  additional_unplanned.append(self.total_unplanned[i] - self.total_unplanned[i - 1])
          Severity: Minor
          Found in scripts/graph.py and 1 other location - About 55 mins to fix
          scripts/graph.py on lines 97..97

          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 37.

          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

                  additional.append(self.total[i] - self.total[i - 1])
          Severity: Minor
          Found in scripts/graph.py and 1 other location - About 55 mins to fix
          scripts/graph.py on lines 98..98

          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 37.

          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

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

              def inspect_backlog
                @planning_board.backlog_cards.each do |card|
                  if @seabed_card && card == @seabed_card
                    break
                  elsif @waterline_card && card == @waterline_card
          Severity: Minor
          Found in lib/scrum/backlog_mover.rb - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

            def multi_update
              CliSettings.process_global_options options
              board_list = YAML.load_file(options['board-list'])
              board_list.each_key do |name|
                raise 'invalid character in team name' if name =~ /[^[:alnum:]. _]/ # sanitize
          Severity: Minor
          Found in lib/cli/burndown.rb - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              if len(bonus_tasks_done) > 0:
                ymin_bonus_tasks = min(bonus_tasks_done) -3
              else:
                ymin_bonus_tasks = 0
          Severity: Minor
          Found in scripts/burndowndata.py and 1 other location - About 45 mins to fix
          scripts/burndowndata.py on lines 137..140

          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 35.

          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

              if len(unplanned_tasks_done) > 0:
                ymin_unplanned_tasks = min(unplanned_tasks_done) -3
              else:
                ymin_unplanned_tasks = 0
          Severity: Minor
          Found in scripts/burndowndata.py and 1 other location - About 45 mins to fix
          scripts/burndowndata.py on lines 132..135

          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 35.

          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

          Function drawUnplanned has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def drawUnplanned(self, color_unplanned, marker, linestyle, linewidth, label):
          Severity: Minor
          Found in scripts/graph.py - About 35 mins to fix

            Function calculateYRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def calculateYRange(self, total_story_points, bonus_tasks_done, bonus_story_points_done, unplanned_tasks_done, unplanned_story_points_done):
            Severity: Minor
            Found in scripts/burndowndata.py - About 35 mins to fix

              Function calculateYRange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def calculateYRange(self, total_story_points, bonus_tasks_done, bonus_story_points_done, unplanned_tasks_done, unplanned_story_points_done):
                  self.ymax = total_story_points + 3
              
                  if len(bonus_tasks_done) > 0:
                    ymin_bonus_tasks = min(bonus_tasks_done) -3
              Severity: Minor
              Found in scripts/burndowndata.py - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                def self.require_trello_credentials
                  write_back = false
              
                  unless @@settings.developer_public_key
                    puts 'Put in Trello developer public key:'
              Severity: Minor
              Found in lib/cli_settings.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

              Severity
              Category
              Status
              Source
              Language