Method remove_incompatible_initial
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def remove_incompatible_initial(aps, verbose)
if verbose
puts "\n--> Applying incompatible initial arguments optimization:"
end
checker = ->(rules, type, suffix, initial) do
- Read upRead up
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 remove_enthymemes
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def remove_enthymemes(aps, verbose)
if verbose
puts "\n--> Applying enthymemes optimization:"
end
removed = []
- Read upRead up
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 fill_usage_hashes
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def fill_usage_hashes(aps)
@premises_hash = Hash.new(nil)
@modif_hash = Hash.new(nil)
@user_hash = Hash.new(nil)
- Read upRead up
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 remove_enthymemes
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_enthymemes(aps, verbose)
if verbose
puts "\n--> Applying enthymemes optimization:"
end
removed = []
Method prune_empty_rules
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def prune_empty_rules(aps, verbose)
if verbose
puts "\n--> Pruning empty rules:"
end
- Read upRead up
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 remove_dominated
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def remove_dominated(aps, verbose)
if verbose
puts "\n--> Applying dominated arguments optimization:"
end
graph = AtkGraph::Graph.new
- Read upRead up
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 remove_irrelevant_args
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_irrelevant_args(aps, verbose)
if verbose
puts "\n--> Applying irrelevant arguments optimization:"
end
remove = ->(set, num="") do
Method remove_incompatible_initial
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_incompatible_initial(aps, verbose)
if verbose
puts "\n--> Applying incompatible initial arguments optimization:"
end
checker = ->(rules, type, suffix, initial) do
Method remove_dominated
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_dominated(aps, verbose)
if verbose
puts "\n--> Applying dominated arguments optimization:"
end
graph = AtkGraph::Graph.new
Method fill_usage_hashes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fill_usage_hashes(aps)
@premises_hash = Hash.new(nil)
@modif_hash = Hash.new(nil)
@user_hash = Hash.new(nil)
Method remove_irrelevant_args
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def remove_irrelevant_args(aps, verbose)
if verbose
puts "\n--> Applying irrelevant arguments optimization:"
end
remove = ->(set, num="") do
- Read upRead up
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 optimize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def optimize(aps, verbose=true, cycle=true, optimizations=[])
aps if optimizations.include?(:none)
flags_list = [:irrelevant, :initial, :enthymeme, :dominated]
(f = (optimizations - flags_list)) and (raise "Unknown flags :#{f} Known flags are #{flags_list}" unless f.empty?)
optimizations = flags_list if optimizations.empty?
- Read upRead up
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"