cotag/spider-gazelle

View on GitHub
lib/spider-gazelle/spider.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method load_gazelles has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def load_gazelles(mode, count, options)
            defer = @thread.defer
            @loading[mode] = defer

            if mode == :inline
Severity: Minor
Found in lib/spider-gazelle/spider.rb - About 1 hr to fix

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

            def load_gazelle_thread(reactor, thread, mode, options, loading)
    Severity: Minor
    Found in lib/spider-gazelle/spider.rb - About 35 mins to fix

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

              def ready
                  load_promise = load_applications
                  load_promise.then do
                      # Check a shutdown request didn't occur as we were loading
                      if @running
      Severity: Minor
      Found in lib/spider-gazelle/spider.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 load_applications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              def load_applications
                  loaded = []
                  @logger.info "Environment: #{ENV['RACK_ENV']} on #{RUBY_ENGINE || 'ruby'} #{RUBY_VERSION}"
      
                  # Load the different types of gazelles required
      Severity: Minor
      Found in lib/spider-gazelle/spider.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

      There are no issues that match your filters.

      Category
      Status