Showing 16 of 16 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class Function
class Numeric
 
# A class representing a subtraction function
class Subtraction < Numeric
Severity: Major
Found in lib/axiom/function/numeric/subtraction.rb and 2 other locations - About 45 mins to fix
lib/axiom/function/numeric/addition.rb on lines 4..57
lib/axiom/function/numeric/multiplication.rb on lines 4..57

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class Function
class Numeric
 
# A class representing a multiplication function
class Multiplication < Numeric
Severity: Major
Found in lib/axiom/function/numeric/multiplication.rb and 2 other locations - About 45 mins to fix
lib/axiom/function/numeric/addition.rb on lines 4..57
lib/axiom/function/numeric/subtraction.rb on lines 4..57

Similar blocks of code found in 3 locations. Consider refactoring.
Open

class Function
class Numeric
 
# A class representing an addition function
class Addition < Numeric
Severity: Major
Found in lib/axiom/function/numeric/addition.rb and 2 other locations - About 45 mins to fix
lib/axiom/function/numeric/multiplication.rb on lines 4..57
lib/axiom/function/numeric/subtraction.rb on lines 4..57

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

class Function
class Numeric
 
# A class representing a unary minus function
class UnaryMinus < Numeric
Severity: Minor
Found in lib/axiom/function/numeric/unary_minus.rb and 1 other location - About 40 mins to fix
lib/axiom/function/numeric/unary_plus.rb on lines 4..55

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

class Function
class Numeric
 
# A class representing a unary plus function
class UnaryPlus < Numeric
Severity: Minor
Found in lib/axiom/function/numeric/unary_plus.rb and 1 other location - About 40 mins to fix
lib/axiom/function/numeric/unary_minus.rb on lines 4..55

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

def self.coerce(object)
if object.kind_of?(Attribute)
object
elsif equal?(Attribute)
Object.coerce(object)
Severity: Minor
Found in lib/axiom/attribute.rb - About 35 mins to fix

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

def initialize(_name, options = EMPTY_HASH)
super
min, max = options.values_at(:minimum_length, :maximum_length)
return unless min || max
@type = type.new do
Severity: Minor
Found in lib/axiom/attribute/length_comparable.rb - About 35 mins to fix

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

class Relation
module Operation
 
# A class representing a deletion from a relation
class Deletion < Relation
Severity: Minor
Found in lib/axiom/relation/operation/deletion.rb and 1 other location - About 20 mins to fix
lib/axiom/relation/operation/insertion.rb on lines 4..40

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

class Relation
module Operation
 
# A class representing an insertion into a relation
class Insertion < Relation
Severity: Minor
Found in lib/axiom/relation/operation/insertion.rb and 1 other location - About 20 mins to fix
lib/axiom/relation/operation/deletion.rb on lines 4..40

Similar blocks of code found in 4 locations. Consider refactoring.
Open

class Function
class Predicate
 
# A predicate representing a greater than test between operands
class GreaterThan < Predicate
Severity: Minor
Found in lib/axiom/function/predicate/greater_than.rb and 3 other locations - About 15 mins to fix
lib/axiom/function/predicate/greater_than_or_equal_to.rb on lines 4..60
lib/axiom/function/predicate/less_than.rb on lines 4..60
lib/axiom/function/predicate/less_than_or_equal_to.rb on lines 4..60

Similar blocks of code found in 3 locations. Consider refactoring.
Open

each_count do |array, relation, count|
relation = relation.sort_by { |r| [r.id, r.name] }
 
gc_statistics "last (#{count} tuples)" do
relation.last(count).each {}
Severity: Minor
Found in benchmarks/memory.rb and 2 other locations - About 15 mins to fix
benchmarks/memory.rb on lines 134..138
benchmarks/memory.rb on lines 150..154

Similar blocks of code found in 3 locations. Consider refactoring.
Open

each_count do |array, relation, count|
relation = relation.sort_by { |r| [r.id, r.name] }
 
gc_statistics "first (#{count} tuples)" do
relation.first(count).each {}
Severity: Minor
Found in benchmarks/memory.rb and 2 other locations - About 15 mins to fix
benchmarks/memory.rb on lines 134..138
benchmarks/memory.rb on lines 158..162

Similar blocks of code found in 3 locations. Consider refactoring.
Open

each_count do |array, relation, count|
relation = relation.sort_by { |r| [r.id, r.name] }
 
gc_statistics "take (#{count} tuples)" do
relation.take(count).each {}
Severity: Minor
Found in benchmarks/memory.rb and 2 other locations - About 15 mins to fix
benchmarks/memory.rb on lines 150..154
benchmarks/memory.rb on lines 158..162

Similar blocks of code found in 4 locations. Consider refactoring.
Open

class Function
class Predicate
 
# A predicate representing a less than test between operands
class LessThan < Predicate
Severity: Minor
Found in lib/axiom/function/predicate/less_than.rb and 3 other locations - About 15 mins to fix
lib/axiom/function/predicate/greater_than.rb on lines 4..60
lib/axiom/function/predicate/greater_than_or_equal_to.rb on lines 4..60
lib/axiom/function/predicate/less_than_or_equal_to.rb on lines 4..60

Similar blocks of code found in 4 locations. Consider refactoring.
Open

class Function
class Predicate
 
# A predicate representing a less than or equal to test between operands
class LessThanOrEqualTo < Predicate
Severity: Minor
Found in lib/axiom/function/predicate/less_than_or_equal_to.rb and 3 other locations - About 15 mins to fix
lib/axiom/function/predicate/greater_than.rb on lines 4..60
lib/axiom/function/predicate/greater_than_or_equal_to.rb on lines 4..60
lib/axiom/function/predicate/less_than.rb on lines 4..60

Similar blocks of code found in 4 locations. Consider refactoring.
Open

class Function
class Predicate
 
# A predicate representing a greater than or equal to test between operands
class GreaterThanOrEqualTo < Predicate
Severity: Minor
Found in lib/axiom/function/predicate/greater_than_or_equal_to.rb and 3 other locations - About 15 mins to fix
lib/axiom/function/predicate/greater_than.rb on lines 4..60
lib/axiom/function/predicate/less_than.rb on lines 4..60
lib/axiom/function/predicate/less_than_or_equal_to.rb on lines 4..60
Severity
Category
Status
Source
Language