ronin-rb/ronin-code-sql

View on GitHub

Showing 5 of 5 total issues

File functions.rb has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ronin/code/sql/function'

module Ronin
  module Code
    module SQL
Severity: Minor
Found in lib/ronin/code/sql/functions.rb - About 3 hrs to fix

    Class Emitter has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Emitter
    
            # The case to use when emitting keywords
            #
            # @return [:lower, :upper, :random, nil]
    Severity: Minor
    Found in lib/ronin/code/sql/emitter.rb - About 2 hrs to fix

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

              def to_sql(terminate: false, **kwargs)
                emitter = emitter(**kwargs)
                sql     = @expression.to_sql(**kwargs)
      
                unless clauses.empty?
      Severity: Minor
      Found in lib/ronin/code/sql/injection.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 emit_statement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

              def emit_statement(stmt)
                sql = emit_keyword(stmt.keyword)
      
                unless stmt.argument.nil?
                  sql << @space << case stmt.argument
      Severity: Minor
      Found in lib/ronin/code/sql/emitter.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 export_set has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def export_set(bits,on,off,separator=nil,number_of_bits=nil)
      Severity: Minor
      Found in lib/ronin/code/sql/functions.rb - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language