lightstep/lightstep-tracer-ruby

View on GitHub

Showing 7 of 7 total issues

Method test_body has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_body(tracer, control)
  repeat    = control['Repeat']
  sleepnano = control['Sleep']
  sleepival = control['SleepInterval']
  work      = control['Work']
Severity: Minor
Found in benchmark.rb - About 1 hr to fix

    Method flush has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def flush
          reset_on_fork
    
          return if @span_records.empty?
    
    
    Severity: Minor
    Found in lib/lightstep/reporter.rb - About 1 hr to fix

      Method loop has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def loop()
        while true do
          uri = URI.parse($base_url + '/control')
          resp = Net::HTTP.get(uri)
          control = JSON.parse(resp)
      Severity: Minor
      Found in benchmark.rb - About 1 hr to fix

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

            def initialize(
              tracer:,
              operation_name:,
              child_of: nil,
              references: [],
        Severity: Minor
        Found in lib/lightstep/span.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 loop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def loop()
          while true do
            uri = URI.parse($base_url + '/control')
            resp = Net::HTTP.get(uri)
            control = JSON.parse(resp)
        Severity: Minor
        Found in benchmark.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 configure has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def configure(component_name:,
                          access_token: nil,
                          transport: nil, tags: {},
                          propagator: :lightstep)
        
        
        Severity: Minor
        Found in lib/lightstep/tracer.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 start_span has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def start_span(operation_name, child_of: nil, references: nil, start_time: nil, tags: nil, ignore_active_scope: false)
              if child_of.nil? && references.nil? && !ignore_active_scope
                child_of = active_span
              end
        
        
        Severity: Minor
        Found in lib/lightstep/tracer.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