Showing 419 of 503 total issues

Function find_super has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  Opal.find_super = function(obj, mid, current_func, defcheck, allow_stubs) {
Severity: Minor
Found in opal/corelib/runtime.js - About 35 mins to fix

    Function find_block_super has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      Opal.find_block_super = function(obj, jsid, current_func, defcheck, implicit) {
    Severity: Minor
    Found in opal/corelib/runtime.js - About 35 mins to fix

      Method processor_for has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def processor_for(source, rel_path, abs_path, autoload, options)
      Severity: Minor
      Found in lib/opal/builder.rb - About 35 mins to fix

        Method mcall has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def PP.mcall(obj, mod, meth, *args, &block)
        Severity: Minor
        Found in stdlib/pp.rb - About 35 mins to fix

          Method complete has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def complete(id, opt, icase = false, *pat, &block)
          Severity: Minor
          Found in stdlib/optparse.rb - About 35 mins to fix

            Method group has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
            Severity: Minor
            Found in stdlib/prettyprint.rb - About 35 mins to fix

              Method group has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length)
              Severity: Minor
              Found in stdlib/prettyprint.rb - About 35 mins to fix

                Method summarize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
                Severity: Minor
                Found in stdlib/optparse.rb - About 35 mins to fix

                  Method update has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def update(sw, sopts, lopts, nsw = nil, nlopts = nil) # :nodoc:
                  Severity: Minor
                  Found in stdlib/optparse.rb - About 35 mins to fix

                    Method summarize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = '')
                    Severity: Minor
                    Found in stdlib/optparse.rb - About 35 mins to fix

                      Method set has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def set(offset, value, bits = 8, type = :unsigned, little = false)
                      Severity: Minor
                      Found in stdlib/buffer/view.rb - About 35 mins to fix

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

                              if code.start_with? 'ls '
                                eval_code = code[3..-1]
                                mode = :ls
                              elsif code == 'ls'
                                eval_code = 'self'
                        Severity: Minor
                        Found in lib/opal/repl.rb and 1 other location - About 35 mins to fix
                        opal/corelib/irb.rb on lines 124..136

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 36.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                if line.start_with? 'ls '
                                  code = line[3..-1]
                                  mode = :ls
                                elsif line == "ls\n"
                                  code = 'self'
                        Severity: Minor
                        Found in opal/corelib/irb.rb and 1 other location - About 35 mins to fix
                        lib/opal/repl.rb on lines 80..92

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 36.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                          def ==(other)
                            return false unless other.instance_of?(self.class)
                        
                            %x{
                              var recursed1 = {}, recursed2 = {};
                        Severity: Minor
                        Found in opal/corelib/struct.rb and 1 other location - About 35 mins to fix
                        opal/corelib/struct.rb on lines 208..231

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 36.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                          def eql?(other)
                            return false unless other.instance_of?(self.class)
                        
                            %x{
                              var recursed1 = {}, recursed2 = {};
                        Severity: Minor
                        Found in opal/corelib/struct.rb and 1 other location - About 35 mins to fix
                        opal/corelib/struct.rb on lines 172..195

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 36.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                            def _lesser_than_end?(val)
                              end_ = self.end || `inf`
                              if step > 0
                                exclude_end? ? val < end_ : val <= end_
                              else
                        Severity: Minor
                        Found in opal/corelib/enumerator/arithmetic_sequence.rb - About 35 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

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

                          def each_slice(n, &block)
                            n = `$coerce_to(#{n}, #{::Integer}, 'to_int')`
                        
                            if `n <= 0`
                              ::Kernel.raise ::ArgumentError, 'invalid slice size'
                        Severity: Minor
                        Found in opal/corelib/enumerable.rb - About 35 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

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

                          def <=>(other)
                            if ::Time === other
                              to_f <=> other.to_f
                            else
                              r = other <=> self
                        Severity: Minor
                        Found in opal/corelib/time.rb - About 35 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

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

                          def module_eval(*args, &block)
                            if block.nil? && `!!Opal.compile`
                              ::Kernel.raise ::ArgumentError, 'wrong number of arguments (0 for 1..3)' unless (1..3).cover? args.size
                        
                              string, file, _lineno = *args
                        Severity: Minor
                        Found in opal/corelib/module.rb - About 35 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

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

                          def to_s
                            result = @real.inspect
                        
                            result +=
                              if (::Number === @imag && @imag.nan?) || @imag.positive? || @imag.zero?
                        Severity: Minor
                        Found in opal/corelib/complex.rb - About 35 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