alf-tool/alf-sql

View on GitHub

Showing 8 of 8 total issues

Class Compiler has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Compiler < Alf::Compiler

      def join(plan)
        Builder.new
      end
Severity: Minor
Found in lib/alf/sql/compiler.rb - About 2 hrs to fix

    Class Builder has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Builder
    
          DISTINCT     = Grammar.sexpr([:set_quantifier, "distinct"])
          ALL          = Grammar.sexpr([:set_quantifier, "all"])
          IS_TABLE_DEE = Grammar.sexpr([:select_list,
    Severity: Minor
    Found in lib/alf/sql/builder.rb - About 2 hrs to fix

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

            def rewrite(plan, expr, compiled, processor, args = [])
      Severity: Minor
      Found in lib/alf/sql/compiler.rb - About 35 mins to fix

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

              def to_sql(buffer = "")
                each_with_index do |child, index|
                  next if index == 0
                  unless index == 1
                    buffer << Sql::Expr::SPACE << to_sql_operator << Sql::Expr::SPACE
        Severity: Minor
        Found in lib/alf/predicate/nodes/nadic_bool.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 build_semijoin_predicate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

                def build_semijoin_predicate(left, right)
                  if right.is_table_dee?
                    right.where_clause.predicate
                  else
                    commons  = left.to_attr_list & right.to_attr_list
        Severity: Minor
        Found in lib/alf/sql/processor/semi_join.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 to_sql has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def to_sql(buffer = "", parenthesize = !buffer.empty?)
                if parenthesize
                  sql_parenthesized(buffer){|b| to_sql(b, false) }
                else
                  left.to_sql(buffer, true)
        Severity: Minor
        Found in lib/alf/sql/nodes/set_operator.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 to_sql has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def to_sql(buffer = "", parenthesize = !buffer.empty?)
                if parenthesize
                  sql_parenthesized(buffer){|b| to_sql(b, false) }
                else
                  buffer << (distinct? ? SELECT_DISTINCT : SELECT)
        Severity: Minor
        Found in lib/alf/sql/nodes/select_exp.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 to_sql has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def to_sql(buffer = "")
                identifier.to_sql(buffer)
                buffer << Sql::Expr::SPACE << Sql::Expr::IN << Sql::Expr::SPACE
                if subquery?
                  values.to_sql(buffer)
        Severity: Minor
        Found in lib/alf/predicate/nodes/in.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