cotag/spider-gazelle

View on GitHub

Showing 28 of 28 total issues

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

            def initialize(return_method, callbacks, thread, logger, gazelles)
Severity: Minor
Found in lib/spider-gazelle/spider/http1.rb - About 35 mins to fix

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

            def boot(running, signaller, options)
                logger = ::SpiderGazelle::Logger.instance
    
                begin
                    # What do we want to do?
    Severity: Minor
    Found in lib/spider-gazelle.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 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 write_response has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

                def write_response(request, status, headers, body)
                    keep_alive = request.keep_alive
    
                    if headers['Content-Length']
                        headers['Content-Length'] = headers['Content-Length'].to_s
    Severity: Minor
    Found in lib/spider-gazelle/spider/http1.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

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

                def self.configure_tls(opts)
                    return false unless opts[:tls]
    
                    tls = {
                        protocols: PROTOCOLS,
    Severity: Minor
    Found in lib/spider-gazelle/spider/app_store.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 process_next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                def process_next
                    @processing = @requests.shift
                    if @processing
                        request = @processing
    
    
    Severity: Minor
    Found in lib/spider-gazelle/spider/http1.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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def log(error, context, trace = nil)
                msg = String.new
                if error.respond_to?(:backtrace)
                    msg << "unhandled exception: #{error.message} (#{context})"
                    backtrace = error.backtrace
    Severity: Minor
    Found in lib/spider-gazelle/reactor.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