47colborne/cloud-sesame

View on GitHub

Showing 3 of 3 total issues

Class Base has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Base
      extend Forwardable

      def_delegators :client, :config, :caching_with

Severity: Minor
Found in lib/cloud_sesame/domain/base.rb - About 3 hrs to fix

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

            def parse(type)
              if type && type.respond_to?(:parse)
                @changed = true
                value[1] = type.parse(self.begin) unless self.begin.to_s.empty?
                value[2] = type.parse(self.end) unless self.end.to_s.empty?
    Severity: Minor
    Found in lib/cloud_sesame/query/ast/range_value.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 compile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                    def compile
                        if query && !query.empty?
                            compiled = "(#{ query })"
    
                            [context[:fuzziness], context[:sloppiness]].each do |parser|
    Severity: Minor
    Found in lib/cloud_sesame/query/node/query.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