technicalpickles/jeweler

View on GitHub

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

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

                  class Jeweler
                    # Rake tasks for putting a Jeweler gem on Gemcutter.
                    #
                    # Jeweler::Tasks.new needs to be used before this.
                    #
                  Severity: Minor
                  Found in lib/jeweler/rubygems_tasks.rb and 1 other location - About 50 mins to fix
                  lib/jeweler/rubygems_dot_org_tasks.rb on lines 4..36

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

                  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

                  class Jeweler
                    # Rake tasks for putting a Jeweler gem on Gemcutter.
                    #
                    # Jeweler::Tasks.new needs to be used before this.
                    #
                  Severity: Minor
                  Found in lib/jeweler/rubygems_dot_org_tasks.rb and 1 other location - About 50 mins to fix
                  lib/jeweler/rubygems_tasks.rb on lines 4..36

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

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

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

                    class Generator
                      module MicronautMixin
                        def self.extended(generator)
                          generator.development_dependencies << ['spicycode-micronaut', '>= 0']
                        end
                  Severity: Major
                  Found in lib/jeweler/generator/micronaut_mixin.rb and 5 other locations - About 40 mins to fix
                  lib/jeweler/generator/bacon_mixin.rb on lines 2..37
                  lib/jeweler/generator/minitest_mixin.rb on lines 2..37
                  lib/jeweler/generator/riot_mixin.rb on lines 2..37
                  lib/jeweler/generator/shoulda_mixin.rb on lines 2..37
                  lib/jeweler/generator/testspec_mixin.rb on lines 2..37

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

                    class Generator
                      module TestspecMixin
                        def self.extended(generator)
                          generator.development_dependencies << ['test-spec', '>= 0']
                        end
                  Severity: Major
                  Found in lib/jeweler/generator/testspec_mixin.rb and 5 other locations - About 40 mins to fix
                  lib/jeweler/generator/bacon_mixin.rb on lines 2..37
                  lib/jeweler/generator/micronaut_mixin.rb on lines 2..37
                  lib/jeweler/generator/minitest_mixin.rb on lines 2..37
                  lib/jeweler/generator/riot_mixin.rb on lines 2..37
                  lib/jeweler/generator/shoulda_mixin.rb on lines 2..37

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

                    class Generator
                      module BaconMixin
                        def self.extended(generator)
                          generator.development_dependencies << ['bacon', '>= 0']
                        end
                  Severity: Major
                  Found in lib/jeweler/generator/bacon_mixin.rb and 5 other locations - About 40 mins to fix
                  lib/jeweler/generator/micronaut_mixin.rb on lines 2..37
                  lib/jeweler/generator/minitest_mixin.rb on lines 2..37
                  lib/jeweler/generator/riot_mixin.rb on lines 2..37
                  lib/jeweler/generator/shoulda_mixin.rb on lines 2..37
                  lib/jeweler/generator/testspec_mixin.rb on lines 2..37

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

                    class Generator
                      module MinitestMixin
                        def self.extended(generator)
                          generator.development_dependencies << ['minitest', '>= 0']
                        end
                  Severity: Major
                  Found in lib/jeweler/generator/minitest_mixin.rb and 5 other locations - About 40 mins to fix
                  lib/jeweler/generator/bacon_mixin.rb on lines 2..37
                  lib/jeweler/generator/micronaut_mixin.rb on lines 2..37
                  lib/jeweler/generator/riot_mixin.rb on lines 2..37
                  lib/jeweler/generator/shoulda_mixin.rb on lines 2..37
                  lib/jeweler/generator/testspec_mixin.rb on lines 2..37

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language