evolve75/RubyTree

View on GitHub

Showing 33 of 33 total issues

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(name, template, default, help_default, desc)
Severity: Minor
Found in setup.rb - About 35 mins to fix

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

      def parsearg_install
        @config.no_harm = false
        @config.install_prefix = ''
        while a = ARGV.shift
          case a
    Severity: Minor
    Found in setup.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

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

      def exec_task_traverse(task)
        run_hook "pre-#{task}"
        FILETYPES.each do |type|
          if type == 'ext' and config('without-ext') == 'yes'
            $stderr.puts 'skipping ext/* by user option' if verbose?
    Severity: Minor
    Found in setup.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

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

      def new_shebang(old)
        if /\Aruby/ =~ File.basename(old.cmd)
          Shebang.new(config('rubypath'), old.args)
        elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby'
          Shebang.new(config('rubypath'), old.args[1..-1])
    Severity: Minor
    Found in setup.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

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

      def mkdir_p(dirname, prefix = nil)
        dirname = prefix + File.expand_path(dirname) if prefix
        $stderr.puts "mkdir -p #{dirname}" if verbose?
        return if no_harm?
    
    
    Severity: Minor
    Found in setup.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

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

      def parsearg_global
        while arg = ARGV.shift
          case arg
          when /\A\w+\z/
            setup_rb_error "invalid task: #{arg}" unless valid_task?(arg)
    Severity: Minor
    Found in setup.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

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

        def from_hash(hash)
          raise ArgumentError, 'Argument must be a type of hash'\
                               unless hash.is_a?(Hash)
    
          raise ArgumentError, 'Hash must have one top-level element'\
    Severity: Minor
    Found in lib/tree/utils/hash_converter.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

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

      def each_selected_installers
        Dir.mkdir 'packages' unless File.dir?('packages')
        @selected.each do |pack|
          $stderr.puts "Processing the package `#{pack}' ..." if verbose?
          Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}")
    Severity: Minor
    Found in setup.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

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

      def dive_into(rel)
        return unless File.dir?("#{@srcdir}/#{rel}")
    
        dir = File.basename(rel)
        Dir.mkdir dir unless File.dir?(dir)
    Severity: Minor
    Found in setup.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

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

        def each(&block)             # :yields: node
    
         return self.to_enum unless block_given?
    
          node_stack = [self]   # Start with this node
    Severity: Minor
    Found in lib/tree.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

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

      def exec_test
        unless File.directory?('test')
          $stderr.puts 'no test in this package' if verbose?
          return
        end
    Severity: Minor
    Found in setup.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

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

      def invoke
        run_metaconfigs
        case task = parsearg_global()
        when nil, 'all'
          parsearg_config
    Severity: Minor
    Found in setup.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

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

        def [](name_or_index, num_as_name=false)
          raise ArgumentError,
                'Name_or_index needs to be provided!' if name_or_index == nil
    
          if name_or_index.kind_of?(Integer) and not num_as_name
    Severity: Minor
    Found in lib/tree.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