undr/influxdb-arel

View on GitHub

Showing 4 of 6 total issues

Class Visitor has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Visitor
      WHERE = ' WHERE '
      SPACE = ' '
      COMMA = ', '
      GROUP_BY = ' GROUP BY '
Severity: Minor
Found in lib/influxdb/arel/visitor.rb - About 5 hrs to fix

    Class SelectManager has 26 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class SelectManager < Arel::TreeManager
          DIRECTIONS = [:asc, :desc].freeze
    
          def initialize(*tables, &block)
            super()
    Severity: Minor
    Found in lib/influxdb/arel/select_manager.rb - About 3 hrs to fix

      Method from has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def from(*new_tables, &block)
              new_tables = new_tables.compact
              return self if new_tables.empty? && !block_given?
      
              expr = Clauses::FromClause.new(*new_tables, &block).to_arel
      Severity: Minor
      Found in lib/influxdb/arel/select_manager.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 initialize_copy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def initialize_copy(other)
                super
                self.wheres = wheres.map{|where| where.clone }
                self.groups = groups.map{|group| group.clone }
                self.attributes = attributes.map{|attribute| attribute.clone }
      Severity: Minor
      Found in lib/influxdb/arel/nodes/select_statement.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

      Severity
      Category
      Status
      Source
      Language