technicalpickles/jeweler

View on GitHub

Showing 22 of 35 total issues

Method define has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def define
      task :version_required do
        if jeweler.expects_version_file? && !jeweler.version_file_exist?
          abort "Expected VERSION or VERSION.yml to exist. Use 'rake version:write' to create an initial one."
        end
Severity: Major
Found in lib/jeweler/tasks.rb - About 4 hrs to fix

    Method initialize has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def initialize(args)
            super()
    
            @orig_args = args.clone
            self[:testing_framework]       = :shoulda
    Severity: Major
    Found in lib/jeweler/generator/options.rb - About 4 hrs to fix

      Class Jeweler has 24 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Jeweler
        require 'jeweler/errors'
        require 'rubygems/user_interaction'
        require 'rubygems/package'
      
      
      Severity: Minor
      Found in lib/jeweler.rb - About 2 hrs to fix

        Method set_jeweler_defaults has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def set_jeweler_defaults(base_dir, git_base_dir = nil)
              base_dir = File.expand_path(base_dir)
              git_base_dir = if git_base_dir
                               File.expand_path(git_base_dir)
                             else
        Severity: Minor
        Found in lib/jeweler/specification.rb - About 2 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 initialize has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def initialize(options = {})
              self.options = options
              extracted_directory = nil
        
              self.project_name   = options[:project_name]
        Severity: Minor
        Found in lib/jeweler/generator.rb - About 2 hrs to fix

          Method initialize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize(options = {})
                self.options = options
                extracted_directory = nil
          
                self.project_name   = options[:project_name]
          Severity: Minor
          Found in lib/jeweler/generator.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 define has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def define
                task :version_required do
                  if jeweler.expects_version_file? && !jeweler.version_file_exist?
                    abort "Expected VERSION or VERSION.yml to exist. Use 'rake version:write' to create an initial one."
                  end
          Severity: Minor
          Found in lib/jeweler/tasks.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 set_jeweler_defaults has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def set_jeweler_defaults(base_dir, git_base_dir = nil)
                base_dir = File.expand_path(base_dir)
                git_base_dir = if git_base_dir
                                 File.expand_path(git_base_dir)
                               else
          Severity: Minor
          Found in lib/jeweler/specification.rb - About 1 hr to fix

            Method run! has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def run!(*arguments)
                      options = build_options(arguments)
            
                      if options[:invalid_argument]
                        $stderr.puts options[:invalid_argument]
            Severity: Minor
            Found in lib/jeweler/generator/application.rb - About 1 hr to fix

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

                    def find_missing_dependencies
                      if Gem::Specification.respond_to?(:find_by_name)
                        dependencies.select do |dependency|
                          begin
                            spec = Gem::Specification.find_by_name(dependency.name, *dependency.requirement.as_list)
              Severity: Minor
              Found in lib/jeweler/commands/check_dependencies.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 define has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def define
                    namespace :rubyforge do
                      namespace :release do
                        desc 'Release the current gem version to RubyForge.'
                        task :gem do
              Severity: Minor
              Found in lib/jeweler/rubyforge_tasks.rb - About 1 hr to fix

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

                    def create_files
                      if File.exist?(target_dir) || File.directory?(target_dir)
                        raise FileInTheWay, "The directory #{target_dir} already exists, aborting. Maybe move it out of the way before continuing?"
                      else
                        FileUtils.mkdir target_dir
                Severity: Minor
                Found in lib/jeweler/generator.rb - About 1 hr to fix

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

                      def define
                        namespace :rubyforge do
                          namespace :release do
                            desc 'Release the current gem version to RubyForge.'
                            task :gem do
                  Severity: Minor
                  Found in lib/jeweler/rubyforge_tasks.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 create_version_control has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_version_control
                        Dir.chdir(target_dir) do
                          begin
                            @repo = Git.init
                          rescue Git::GitExecuteError => e
                  Severity: Minor
                  Found in lib/jeweler/generator.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 write_version has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def write_version(major, minor, patch, build, _options = {})
                  Severity: Minor
                  Found in lib/jeweler.rb - About 35 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return 1
                    Severity: Major
                    Found in lib/jeweler/generator/application.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return 1
                      Severity: Major
                      Found in lib/jeweler/generator/application.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return 1
                        Severity: Major
                        Found in lib/jeweler/generator/application.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return 1
                          Severity: Major
                          Found in lib/jeweler/generator/application.rb - About 30 mins to fix

                            Method create_files has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def create_files
                                  if File.exist?(target_dir) || File.directory?(target_dir)
                                    raise FileInTheWay, "The directory #{target_dir} already exists, aborting. Maybe move it out of the way before continuing?"
                                  else
                                    FileUtils.mkdir target_dir
                            Severity: Minor
                            Found in lib/jeweler/generator.rb - About 25 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