yipdw/analysand

View on GitHub

Showing 5 of 5 total issues

Method _req has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _req(klass, doc_id, credentials, query, headers, body, block)
Severity: Major
Found in lib/analysand/http.rb - About 50 mins to fix

    Method end_object has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def end_object
            if @in_rows
              # If the stack's empty and we've come to the end of an object, assume
              # we've exited the rows key.  Trailing keys are handled by
              # check_toplevel_key_validity.
    Severity: Minor
    Found in lib/analysand/view_streaming/builder.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def each
          return to_enum unless block_given?
    
          while @reader.alive?
            read while @reader.alive? && @generator.staged_rows.empty?
    Severity: Minor
    Found in lib/analysand/streaming_view_response.rb - About 45 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 init_http_client has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def init_http_client(uri)
          unless uri.respond_to?(:path) && uri.respond_to?(:absolute?)
            uri = URI(uri)
          end
    
    
    Severity: Minor
    Found in lib/analysand/http.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 wait_for_http_service has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def wait_for_http_service(uri, timeout = 30)
          state = 1.upto(timeout) do
            if test_http_connection(Catalog::Settings.solr_uri)
              break :started
            else
    Severity: Minor
    Found in lib/analysand/connection_testing.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