therubymug/keymaker

View on GitHub

Showing 3 of 12 total issues

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

  class Service

    extend MatchMethodMacros

    attr_accessor :config
Severity: Minor
Found in lib/keymaker/service.rb - About 2 hrs to fix

    Method process_attrs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def process_attrs(attrs)
        attrs = attrs.symbolize_keys
        self.class.properties.delete_if{|p| p == :node_id}.each do |property|
          if property == :active_record_id
            process_attr(property, attrs[:id].present? ? attrs[:id] : attrs[:active_record_id])
    Severity: Minor
    Found in lib/keymaker/serialization.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 traverse_path_properties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def traverse_path_properties
          # :order - breadth_first or depth_first
          # :relationships - all, in, or out
          #   e.g. [{"type" => "likes", "direction" => "all}]
          # :uniqueness - node_global, none, relationship_global, node_path, or relationship_path
    Severity: Minor
    Found in lib/keymaker/requests/traverse_path_request.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