sanemat/tachikoma

View on GitHub

Showing 6 of 8 total issues

Class Application has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Application
    include FileUtils

    def self.run(strategy)
      new.run(strategy)
Severity: Minor
Found in lib/tachikoma/application.rb - About 3 hrs to fix

    File application.rb has 288 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'safe_yaml'
    require 'uri'
    require 'tachikoma'
    require 'octokit'
    require 'fileutils'
    Severity: Minor
    Found in lib/tachikoma/application.rb - About 2 hrs to fix

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

          def bundler
            Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
              Bundler.with_clean_env do
                sh(*['ruby', '-i', '-pe', '$_.gsub! /^ruby/, "#ruby"', 'Gemfile'])
                sh(*['git', 'config', 'user.name', @commiter_name])
      Severity: Minor
      Found in lib/tachikoma/application.rb - About 1 hr to fix

        Method load has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def load
              @build_for = ENV['BUILD_FOR']
              @github_token = ENV[github_token_key(@build_for)]
        
              base_config_path = File.join(Tachikoma.original_data_path, 'default.yaml')
        Severity: Minor
        Found in lib/tachikoma/application.rb - About 1 hr to fix

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

              def bundler
                Dir.chdir("#{Tachikoma.repos_path}/#{@build_for}") do
                  Bundler.with_clean_env do
                    sh(*['ruby', '-i', '-pe', '$_.gsub! /^ruby/, "#ruby"', 'Gemfile'])
                    sh(*['git', 'config', 'user.name', @commiter_name])
          Severity: Minor
          Found in lib/tachikoma/application.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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def load
                @build_for = ENV['BUILD_FOR']
                @github_token = ENV[github_token_key(@build_for)]
          
                base_config_path = File.join(Tachikoma.original_data_path, 'default.yaml')
          Severity: Minor
          Found in lib/tachikoma/application.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