cequel/cequel

View on GitHub

Showing 473 of 473 total issues

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

    module Persistence
      extend ActiveSupport::Concern
      extend Util::Forwardable
      include Instrumentation

Severity: Minor
Found in lib/cequel/record/persistence.rb by rubocop

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

Class RecordSet has 82 methods (exceeds 20 allowed). Consider refactoring.
Open

    class RecordSet < SimpleDelegator
      extend Util::Forwardable
      extend Cequel::Util::HashAccessors
      include Enumerable
      include BulkWrites
Severity: Major
Found in lib/cequel/record/record_set.rb - About 1 day to fix

    Class has too many lines. [449/412]
    Open

        class RecordSet < SimpleDelegator
          extend Util::Forwardable
          extend Cequel::Util::HashAccessors
          include Enumerable
          include BulkWrites
    Severity: Minor
    Found in lib/cequel/record/record_set.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.

    File record_set.rb has 455 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Cequel
      module Record
        #
        # This class represents a subset of records from a particular table. Record
        # sets encapsulate a CQL query, and are constructed using a chained builder
    Severity: Minor
    Found in lib/cequel/record/record_set.rb - About 6 hrs to fix

      Class DataSet has 48 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class DataSet
            include Enumerable
            extend Util::Forwardable
      
            # @return [Keyspace] keyspace that this data set's table resides in
      Severity: Minor
      Found in lib/cequel/metal/data_set.rb - About 6 hrs to fix

        Block has too many lines. [83/25]
        Open

        namespace :cequel do
          namespace :keyspace do
            desc 'Initialize Cassandra keyspace'
            task :create => :environment do
              create!
        Severity: Minor
        Found in lib/cequel/record/tasks.rb by rubocop

        This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

        Method migrate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

          def migrate
            watch_stack = ActiveSupport::Dependencies::WatchStack.new
        
            migration_table_names = Set[]
            project_root = defined?(Rails) ? Rails.root : Dir.pwd
        Severity: Minor
        Found in lib/cequel/record/tasks.rb - About 3 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

        Class Keyspace has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Keyspace
              extend Util::Forwardable
              include Logging
              include MonitorMixin
        
        
        Severity: Minor
        Found in lib/cequel/metal/keyspace.rb - About 2 hrs to fix

          File data_set.rb has 264 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'forwardable'
          
          module Cequel
            module Metal
              #
          Severity: Minor
          Found in lib/cequel/metal/data_set.rb - About 2 hrs to fix

            Class Table has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class Table
            
                  # @return [Symbol] the name of the table
                  attr_reader :name
            
            
            Severity: Minor
            Found in lib/cequel/schema/table.rb - About 2 hrs to fix

              Assignment Branch Condition size for migrate is too high. [38.01/34]
              Open

                def migrate
                  watch_stack = ActiveSupport::Dependencies::WatchStack.new
              
                  migration_table_names = Set[]
                  project_root = defined?(Rails) ? Rails.root : Dir.pwd
              Severity: Minor
              Found in lib/cequel/record/tasks.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 collection.rb has 252 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'delegate'
              
              module Cequel
                module Record
                  #
              Severity: Minor
              Found in lib/cequel/record/collection.rb - About 2 hrs to fix

                Cyclomatic complexity for execute_with_options_with_newrelic is too high. [8/6]
                Open

                      define_method :execute_with_options_with_newrelic do |statement, options|
                
                        operation = nil
                        statement_txt = nil
                        statement_words = nil

                This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

                An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

                Cyclomatic complexity for migrate is too high. [8/6]
                Open

                  def migrate
                    watch_stack = ActiveSupport::Dependencies::WatchStack.new
                
                    migration_table_names = Set[]
                    project_root = defined?(Rails) ? Rails.root : Dir.pwd
                Severity: Minor
                Found in lib/cequel/record/tasks.rb by rubocop

                This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

                An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

                Method has too many lines. [32/31]
                Open

                  def migrate
                    watch_stack = ActiveSupport::Dependencies::WatchStack.new
                
                    migration_table_names = Set[]
                    project_root = defined?(Rails) ? Rails.root : Dir.pwd
                Severity: Minor
                Found in lib/cequel/record/tasks.rb by rubocop

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

                Method from_result_row has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def self.from_result_row(result_row)
                        if result_row
                          new.tap do |row|
                            result_row.each_pair do |name, value|
                              if name =~ /^(ttl|writetime)\((.+)\)$/
                Severity: Minor
                Found in lib/cequel/metal/row.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 migrate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def migrate
                    watch_stack = ActiveSupport::Dependencies::WatchStack.new
                
                    migration_table_names = Set[]
                    project_root = defined?(Rails) ? Rails.root : Dir.pwd
                Severity: Minor
                Found in lib/cequel/record/tasks.rb - About 1 hr to fix

                  Block has too many lines. [36/25]
                  Open

                  Gem::Specification.new do |s|
                    s.name = 'cequel'
                    s.version = Cequel::VERSION
                    s.authors = [
                      'Mat Brown', 'Aubrey Holland', 'Keenan Brock', 'Insoo Buzz Jung',
                  Severity: Minor
                  Found in cequel.gemspec by rubocop

                  This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

                  Method create! has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def create!(options = {})
                          bare_connection =
                            Metal::Keyspace.new(keyspace.configuration.except(:keyspace))
                  
                          default_options = {
                  Severity: Minor
                  Found in lib/cequel/schema/keyspace.rb - About 1 hr to fix

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

                          def write_attribute(name, value)
                            column = self.class.reflect_on_column(name)
                            fail UnknownAttributeError, "unknown attribute: #{name}" unless column
                            value = column.cast(value) unless value.nil?
                    
                    
                    Severity: Minor
                    Found in lib/cequel/record/persistence.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