Showing 1,475 of 1,481 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  let(:user_struct) do
    repo.users.mapper.model
  end

  let(:task_struct) do
Severity: Major
Found in repository/spec/shared/structs.rb and 1 other location - About 1 day to fix
changeset/spec/shared/structs.rb on lines 2..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 354.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  let(:user_struct) do
    repo.users.mapper.model
  end

  let(:task_struct) do
Severity: Major
Found in changeset/spec/shared/structs.rb and 1 other location - About 1 day to fix
repository/spec/shared/structs.rb on lines 2..138

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 354.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Class has too many lines. [196/150]
Open

    class AttributeDSL
      include ModelDSL

      attr_reader :attributes, :options, :copy_keys, :symbolize_keys, :reject_keys, :steps

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [193/150]
Open

  class Schema
    include Memoizable

    extend Notifications::Listener

Severity: Minor
Found in core/lib/rom/schema.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [192/150]
Open

  class Relation
    # Default no-op output schema which is called in `Relation#each`
    NOOP_OUTPUT_SCHEMA = -> tuple { tuple }.freeze

    extend Initializer
Severity: Minor
Found in core/lib/rom/relation.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [188/150]
Open

    class Transproc < Processor
      include ::Transproc::Composer

      module Functions
        extend ::Transproc::Registry
Severity: Minor
Found in core/lib/rom/processor/transproc.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Module has too many lines. [135/100]
Open

    module ClassInterface
      extend Notifications::Listener

      subscribe('configuration.relations.object.registered') do |event|
        relation = event[:relation]

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

File transproc_spec.rb has 433 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RSpec.describe ROM::Processor::Transproc do
  subject(:transproc) { ROM::Processor::Transproc.build(binding, header) }

  let(:binding) { nil }
  let(:header) { ROM::Header.coerce(attributes, options) }
Severity: Minor
Found in core/spec/unit/rom/processor/transproc_spec.rb - About 6 hrs to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    RSpec.shared_context 'database' do
      include_context 'database setup'
    
      before do
        [:tags, :tasks, :books, :posts_labels, :posts, :users, :labels,
    Severity: Major
    Found in changeset/spec/shared/database.rb and 1 other location - About 5 hrs to fix
    repository/spec/shared/database.rb on lines 13..77

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 186.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    RSpec.shared_context 'database' do
      include_context 'database setup'
    
      before do
        [:tags, :tasks, :books, :posts_labels, :posts, :users, :labels,
    Severity: Major
    Found in repository/spec/shared/database.rb and 1 other location - About 5 hrs to fix
    changeset/spec/shared/database.rb on lines 18..82

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 186.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      before do
        jane_id = conn[:users].insert name: 'Jane'
        joe_id = conn[:users].insert name: 'Joe'
    
        conn[:tasks].insert user_id: joe_id, title: 'Joe Task'
    Severity: Major
    Found in repository/spec/shared/seeds.rb and 1 other location - About 5 hrs to fix
    changeset/spec/shared/seeds.rb on lines 2..29

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 167.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      before do
        jane_id = conn[:users].insert name: 'Jane'
        joe_id = conn[:users].insert name: 'Joe'
    
        conn[:tasks].insert user_id: joe_id, title: 'Joe Task'
    Severity: Major
    Found in changeset/spec/shared/seeds.rb and 1 other location - About 5 hrs to fix
    repository/spec/shared/seeds.rb on lines 2..29

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 167.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File dsl_spec.rb has 373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'spec_helper'
    
    RSpec.describe ROM::Mapper do
      subject(:mapper) do
        klass = Class.new(parent)
    Severity: Minor
    Found in core/spec/unit/rom/mapper/dsl_spec.rb - About 4 hrs to fix

      File repository_spec.rb has 320 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      RSpec.describe 'ROM repository' do
        include_context 'database'
        include_context 'relations'
        include_context 'repo'
        include_context 'structs'
      Severity: Minor
      Found in repository/spec/integration/repository_spec.rb - About 3 hrs to fix

        Assignment Branch Condition size for seed is too high. [35.01/20]
        Open

        def seed
          hr
        
          puts "SEEDING #{USER_SEED.count} users"
          USER_SEED.each do |attributes|
        Severity: Minor
        Found in core/benchmarks/setup.rb by rubocop

        This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

        Assignment Branch Condition size for run! is too high. [35.75/20]
        Open

              def run!
                commands = @command_classes.map do |klass|
                  relation = @relations[klass.relation]
                  gateway = @gateways[relation.gateway]
        
        

        This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

        Assignment Branch Condition size for call is too high. [34.84/20]
        Open

            def call(*args, &block)
              tuples =
                if hooks?
                  prepared =
                    if curried?
        Severity: Minor
        Found in core/lib/rom/command.rb by rubocop

        This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

        File schema_spec.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'spec_helper'
        require 'rom/memory'
        
        RSpec.describe ROM::Relation, '.schema' do
          it 'defines a canonical schema for a relation' do
        Severity: Minor
        Found in core/spec/unit/rom/relation/schema_spec.rb - About 3 hrs to fix

          Assignment Branch Condition size for call is too high. [33.62/20]
          Open

                  def call(*args)
                    first = args.first
                    last = args.last
                    size = args.size
          
          

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Assignment Branch Condition size for register_command is too high. [32.31/20]
          Open

              def register_command(rel_name, type, rel_meta, parent_relation = nil)
                relation = relations[rel_name]
          
                type.create_class(rel_name, type) do |klass|
                  klass.result(rel_meta.fetch(:combine_type, result))
          Severity: Minor
          Found in core/lib/rom/command_compiler.rb by rubocop

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

          Severity
          Category
          Status
          Source
          Language