Showing 1,530 of 1,530 total issues
Block has too many lines. [28/25] Open
Pry.hooks.add_hook(:before_session, "print_banner") do |output, _, pry|
BANNER = <<-BANNER
#{"Mr.CAS = A very simple Computer Algebra System".green}
- Read upRead up
- Exclude checks
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.
Avoid too many return
statements within this method. Open
return @x if @y == CAS::One
Avoid too many return
statements within this method. Open
return CAS::Zero if @y == CAS::Infinity
Avoid too many return
statements within this method. Open
return @x + @y.x if @y.is_a? CAS::Invert
Avoid too many return
statements within this method. Open
return -(@x.x + @y) if @x.is_a? CAS::Invert
Avoid too many return
statements within this method. Open
return @x if @y == CAS::One
Avoid too many return
statements within this method. Open
return CAS::One if @x == @y
Avoid too many return
statements within this method. Open
return self
Avoid too many return
statements within this method. Open
return self
Avoid too many return
statements within this method. Open
return CAS.const(self.call({})) if (@x.is_a? CAS::Constant and @y.is_a? CAS::Constant)
Avoid too many return
statements within this method. Open
return self
Avoid too many return
statements within this method. Open
return CAS::Zero if @x == CAS::Zero
Avoid too many return
statements within this method. Open
return CAS::Zero if @x == CAS::Zero
Avoid too many return
statements within this method. Open
return CAS.const(self.call({})) if (@x.is_a? CAS::Constant and @y.is_a? CAS::Constant)
Avoid too many return
statements within this method. Open
return CAS::Infinity if @y == CAS::Zero
Avoid too many return
statements within this method. Open
return CAS::One if @x == CAS::One
Avoid too many return
statements within this method. Open
return self
Avoid too many return
statements within this method. Open
return CAS::One if @y == CAS::Zero
Method ==
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ==(op)
# CAS::Help.assert(op, CAS::Op)
if op.is_a? CAS::NaryOp
return false if @x.size != op.x.size
0.upto(@x.size - 1) do |i|
- 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
Function hookSearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function hookSearch() {
var input = $('#search-field').eq(0);
var result = $('#search-results').eq(0);
$(result).show();
- 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"