hammackj/uirusu

View on GitHub

Showing 13 of 19 total issues

Method scan_and_wait has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

            def scan_and_wait(mod, resource, attempts)
                method = nil
                retries = attempts

                if mod.name == "Uirusu::VTFile"
Severity: Minor
Found in lib/uirusu/cli/application.rb - About 1 day 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 main has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

            def main(args)
                parse_options(args)
                load_config

                if @options['output'] == :stdout
Severity: Minor
Found in lib/uirusu/cli/application.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 parse_options has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            def parse_options(args)
                begin
                    @options['output']  = :stdout
                    @options['verbose'] = false
                    @options['rescan']  = false
Severity: Major
Found in lib/uirusu/cli/application.rb - About 3 hrs to fix

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

            def initialize hash, results
                if results == nil or results.empty?
                    return
    
                # Take into consideration being passed an array of results.
    Severity: Minor
    Found in lib/uirusu/vtresult.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 parse_options has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

                def parse_options(args)
                    begin
                        @options['output']  = :stdout
                        @options['verbose'] = false
                        @options['rescan']  = false
    Severity: Minor
    Found in lib/uirusu/cli/application.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

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

    module Uirusu
        module CLI
            class Application
    
                attr_accessor :config
    Severity: Minor
    Found in lib/uirusu/cli/application.rb - About 2 hrs to fix

      Method scan_and_wait has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  def scan_and_wait(mod, resource, attempts)
                      method = nil
                      retries = attempts
      
                      if mod.name == "Uirusu::VTFile"
      Severity: Major
      Found in lib/uirusu/cli/application.rb - About 2 hrs to fix

        Method main has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    def main(args)
                        parse_options(args)
                        load_config
        
                        if @options['output'] == :stdout
        Severity: Major
        Found in lib/uirusu/cli/application.rb - About 2 hrs to fix

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

                  def initialize hash, results
                      if results == nil or results.empty?
                          return
          
                      # Take into consideration being passed an array of results.
          Severity: Major
          Found in lib/uirusu/vtresult.rb - About 2 hrs to fix

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

                        def load_config file=CONFIG_FILE
            
                            @config = nil
            
                            f = File.expand_path(file)
            Severity: Minor
            Found in lib/uirusu/cli/application.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 to_xml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def to_xml
                        result_string = String.new
                        result_string << "<results>\n"
                        @results.each do |result|
                            result_string << "\t<vtresult>\n"
            Severity: Minor
            Found in lib/uirusu/vtresult.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 recurse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def Scanner.recurse file_name
                        Dir.new("#{file_name}").each do |file|
                            next if file.match(/^\.+/)
                            path = "#{file_name}/#{file}"
            
            
            Severity: Minor
            Found in lib/uirusu/scanner.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 parse_response has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.parse_response(response)
                    puts "Parse Response"
                    begin
                        case response.code
                            when 429, 204
            Severity: Minor
            Found in lib/uirusu.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