Showing 35 of 394 total issues

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

    class Transproc < Processor
      include ::Transproc::Composer

      module Functions
        extend ::Transproc::Registry
Severity: Minor
Found in core/lib/rom/processor/transproc.rb - About 3 hrs to fix

    Method call has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def call(*args, &block)
          tuples =
            if hooks?
              prepared =
                if curried?
    Severity: Minor
    Found in core/lib/rom/command.rb - About 2 hrs 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 visit_relation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def visit_relation(node, parent_relation = nil)
          name, header, meta = node
          other = header.map { |attr| visit(attr, name) }.compact
    
          if type
    Severity: Minor
    Found in core/lib/rom/command_compiler.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 call has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

          def call(*args)
            response = left.call(*args)
    
            if response.nil? || (many? && response.size == 0)
              return one? ? nil : EMPTY_ARRAY
    Severity: Minor
    Found in core/lib/rom/commands/composite.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 auto_curry has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def auto_curry(name, &block)
          arity = instance_method(name).arity
    
          return unless public_instance_methods.include?(name) && arity != 0
    
    
    Severity: Minor
    Found in core/lib/rom/auto_curry.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 node has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def node(name, &block)
            if name.is_a?(Symbol) && !nodes.map { |n| n.name.key }.include?(name)
              raise ArgumentError, "#{name.inspect} is not a valid aggregate node name"
            end
    
    
    Severity: Minor
    Found in core/lib/rom/relation/combined.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 extract_excluded_keys has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.extract_excluded_keys(nodes)
              return unless nodes
    
              nodes
                .map { |item| item.is_a?(Array) && item.size > 1 ? item.first : item }
    Severity: Minor
    Found in core/lib/rom/commands/graph/input_evaluator.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 call has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

            def call(*args)
              first = args.first
              last = args.last
              size = args.size
    
    
    Severity: Minor
    Found in core/lib/rom/commands/lazy/delete.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 visit_relation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def visit_relation(node, parent_relation = nil)
          name, header, meta = node
          other = header.map { |attr| visit(attr, name) }.compact
    
          if type
    Severity: Minor
    Found in core/lib/rom/command_compiler.rb - About 1 hr to fix

      Method call has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def call(*args, &block)
            tuples =
              if hooks?
                prepared =
                  if curried?
      Severity: Minor
      Found in core/lib/rom/command.rb - About 1 hr to fix

        Method view has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def view(*args, &block)
                if args.size == 1 && block.arity > 0
                  raise ArgumentError, "schema attribute names must be provided as the second argument"
                end
        
        
        Severity: Minor
        Found in core/lib/rom/relation/class_interface.rb - About 1 hr to fix

          Method call has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

                  def call(*args)
                    first = args.first
                    last = args.last
                    size = args.size
          
          
          Severity: Minor
          Found in core/lib/rom/commands/lazy/update.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 changeset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

                    def changeset(type, data = EMPTY_HASH)
                      klass = type.is_a?(Symbol) ? TYPES.fetch(type) : type
          
                      unless klass < ROM::Changeset
                        raise ArgumentError, "+#{type.name}+ must be a Changeset descendant"
          Severity: Minor
          Found in changeset/lib/rom/plugins/relation/changeset.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 visit_relation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def visit_relation(node)
                rel_name, header, meta_options = node
                name = meta_options[:combine_name] || meta_options[:alias] || rel_name
                namespace = meta_options.fetch(:struct_namespace)
          
          
          Severity: Minor
          Found in core/lib/rom/mapper_compiler.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 run! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def run!
                  relation_registry = RelationRegistry.new do |registry, relations|
                    @relation_classes.each do |klass|
                      unless klass.adapter
                        raise MissingAdapterIdentifierError,
          Severity: Minor
          Found in core/lib/rom/setup/finalize/finalize_relations.rb - About 1 hr to fix

            Method build_command has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def build_command(registry, spec, other, path)
                      cmd_opts, nodes = other
            
                      key, relation =
                        if spec.is_a?(Hash)
            Severity: Minor
            Found in core/lib/rom/commands/graph/class_interface.rb - About 1 hr to fix

              Method compose has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                    def compose(other, for_diff: other.is_a?(Pipe) ? other.use_for_diff : false)
                      new_proc = processor ? processor >> other : other
              
                      if for_diff
                        diff_proc = diff_processor ? diff_processor >> other : other
              Severity: Minor
              Found in changeset/lib/rom/changeset/pipe.rb - About 55 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 schema has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                    def schema(dataset = nil, as: nil, infer: false, &block)
                      if defined?(@schema) && !block && !infer
                        @schema
                      elsif block || infer
                        raise MissingSchemaClassError.new(self) unless schema_class
              Severity: Minor
              Found in core/lib/rom/relation/class_interface.rb - About 55 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 call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                    def call(*args)
                      left = root.call(*args)
              
                      right = nodes.map { |node|
                        response =
              Severity: Minor
              Found in core/lib/rom/commands/graph.rb - About 55 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_command has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                      def build_command(registry, spec, other, path)
                        cmd_opts, nodes = other
              
                        key, relation =
                          if spec.is_a?(Hash)
              Severity: Minor
              Found in core/lib/rom/commands/graph/class_interface.rb - About 55 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