torquebox/maven-tools

View on GitHub

Showing 68 of 68 total issues

File dsl.rb has 1317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'fileutils'
require 'maven/tools/gemspec_dependencies'
require 'maven/tools/artifact'
require 'maven/tools/versions'
require 'maven/tools/gemfile_lock'
Severity: Major
Found in lib/maven/tools/dsl.rb - About 3 days to fix

    Method method_missing has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

          def method_missing( method, *args, &block )
            if @context
              m = "#{method}=".to_sym
              if @current.respond_to? m
                if method == :properties && defined? JRUBY_VERSION
    Severity: Minor
    Found in lib/maven/tools/dsl.rb - About 4 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 do_gem has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

          def do_gem( bang, *args )
            # in some setup that gem could overload the Kernel gem
            return if @current.nil?
            unless args[ 0 ].match( /:/ )
              args[ 0 ] = "rubygems:#{args[ 0 ] }"
    Severity: Minor
    Found in lib/maven/tools/dsl.rb - About 4 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

    File model.rb has 323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'virtus'
    
    # keep things in line with java collections
    class Array
      def remove( *args )
    Severity: Minor
    Found in lib/maven/tools/model.rb - About 3 hrs to fix

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

            def gemfile( name = 'Gemfile', options = {} )
              if name.is_a? Hash
                options = name
                name = 'Gemfile'
              end
      Severity: Minor
      Found in lib/maven/tools/dsl.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 gemfile has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def gemfile( name = 'Gemfile', options = {} )
              if name.is_a? Hash
                options = name
                name = 'Gemfile'
              end
      Severity: Major
      Found in lib/maven/tools/dsl.rb - About 3 hrs to fix

        Method setup_gem_support has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

              def setup_gem_support( options, spec = nil, config = {} )
                unless model.properties.member?( 'project.build.sourceEncoding' )
                  properties( 'project.build.sourceEncoding' => 'utf-8' )
                end
                if spec.nil?
        Severity: Minor
        Found in lib/maven/tools/dsl.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 do_dependency has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

              def do_dependency( bang, type, *args, &block )
                d = retrieve_dependency( type, *args )
                container = dependency_container
        
                if bang
        Severity: Minor
        Found in lib/maven/tools/dsl.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 setup_gem_support has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                def setup_gem_support( project, options, spec = nil )
                  unless project.properties.member?( 'project.build.sourceEncoding' )
                    @parent.properties( 'project.build.sourceEncoding' => 'utf-8' )
                  end
                  if spec.nil?
        Severity: Minor
        Found in lib/maven/tools/dsl/gem_support.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 do_repository has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

              def do_repository( method, *args, &block )
                args, options = args_and_options( *args )
                if @current.respond_to?( method )
                  r = DeploymentRepository.new
                else
        Severity: Minor
        Found in lib/maven/tools/dsl.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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

              def initialize( group_id, artifact_id, type,  
                              version = nil, classifier = nil, exclusions = nil,
                              options = {} )
                if exclusions.nil?
                  if version.nil? and !classifier.nil?
        Severity: Minor
        Found in lib/maven/tools/artifact.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 accept_hash has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

              def accept_hash( name, hash )
                unless hash.empty?
                  attr = hash.select do |k, v|
                    [ k, v ] if k.to_s.match( /^@/ )
                  end
        Severity: Minor
        Found in lib/maven/tools/visitor.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 populate_unlocked has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

              def populate_unlocked( container = nil, &block )
                warn 'DEPRECATED use Maven::Tools::DSL::Jarfile instead'
                if ::File.exists?(@file)
                  dsl = Maven::Tools::DSL::Jarfile.new( nil, @file )
        
        
        Severity: Minor
        Found in lib/maven/tools/jarfile.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 setup_gem_support has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def setup_gem_support( project, options, spec = nil )
                  unless project.properties.member?( 'project.build.sourceEncoding' )
                    @parent.properties( 'project.build.sourceEncoding' => 'utf-8' )
                  end
                  if spec.nil?
        Severity: Major
        Found in lib/maven/tools/dsl/gem_support.rb - About 2 hrs to fix

          Method setup_gem_support has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def setup_gem_support( options, spec = nil, config = {} )
                  unless model.properties.member?( 'project.build.sourceEncoding' )
                    properties( 'project.build.sourceEncoding' => 'utf-8' )
                  end
                  if spec.nil?
          Severity: Major
          Found in lib/maven/tools/dsl.rb - About 2 hrs to fix

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

                  def convert(arg, low = nil, high = nil)
                    if arg =~ /~>/
                      val = arg.sub(/~>\s*/, '')
                      last = val=~/\./ ? val.sub(/\.[0-9]*[a-z]+.*$/, '').sub(/\.[^.]+$/, '.99999') : '99999'
                      ["[#{snapshot_version(val)}", "#{snapshot_version(last)}]"]
            Severity: Minor
            Found in lib/maven/tools/coordinate.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 method_missing has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def method_missing( method, *args, &block )
                    if @context
                      m = "#{method}=".to_sym
                      if @current.respond_to? m
                        if method == :properties && defined? JRUBY_VERSION
            Severity: Minor
            Found in lib/maven/tools/dsl.rb - About 1 hr to fix

              Method report_set has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                    def report_set( *reports, &block )
                      set = ReportSet.new
                      case reports.last
                      when Hash
                        options = reports.last
              Severity: Minor
              Found in lib/maven/tools/dsl.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 from has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def self.from( type, *args )
                      if args.last.is_a? Hash
                        options = args.last.dup
                        args = args[0..-2]
                      end
              Severity: Minor
              Found in lib/maven/tools/artifact.rb - About 1 hr to fix

                Method do_dependency has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def do_dependency( bang, type, *args, &block )
                        d = retrieve_dependency( type, *args )
                        container = dependency_container
                
                        if bang
                Severity: Minor
                Found in lib/maven/tools/dsl.rb - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language