MatteoRagni/cas-rb

View on GitHub

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}

Severity: Minor
Found in bin/cas-console 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.

Avoid too many return statements within this method.
Open

      return @x if @y == CAS::One
Severity: Major
Found in lib/functions/fnc-base.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return CAS::Zero if @y == CAS::Infinity
    Severity: Major
    Found in lib/functions/fnc-base.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return @x + @y.x if @y.is_a? CAS::Invert
      Severity: Major
      Found in lib/functions/fnc-base.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return -(@x.x + @y) if @x.is_a? CAS::Invert
        Severity: Major
        Found in lib/functions/fnc-base.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return @x if @y == CAS::One
          Severity: Major
          Found in lib/functions/fnc-base.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return CAS::One if @x == @y
            Severity: Major
            Found in lib/functions/fnc-base.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return self
              Severity: Major
              Found in lib/functions/fnc-base.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return self
                Severity: Major
                Found in lib/functions/fnc-base.rb - About 30 mins to fix

                  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)
                  Severity: Major
                  Found in lib/functions/fnc-base.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return self
                    Severity: Major
                    Found in lib/functions/fnc-base.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                            return CAS::Zero if @x == CAS::Zero
                      Severity: Major
                      Found in lib/functions/fnc-base.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return CAS::Zero if @x == CAS::Zero
                        Severity: Major
                        Found in lib/functions/fnc-base.rb - About 30 mins to fix

                          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)
                          Severity: Major
                          Found in lib/functions/fnc-base.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                  return CAS::Infinity if @y == CAS::Zero
                            Severity: Major
                            Found in lib/functions/fnc-base.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                    return CAS::One if @x == CAS::One
                              Severity: Major
                              Found in lib/functions/fnc-base.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                      return self
                                Severity: Major
                                Found in lib/functions/fnc-base.rb - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                        return CAS::One if @y == CAS::Zero
                                  Severity: Major
                                  Found in lib/functions/fnc-base.rb - About 30 mins to fix

                                    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|
                                    Severity: Minor
                                    Found in lib/operators/nary-op.rb - About 25 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

                                    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();
                                    
                                    
                                    Severity: Minor
                                    Found in docs/js/darkfish.js - About 25 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