ochko/prudge

View on GitHub

Showing 151 of 206 total issues

Avoid too many return statements within this function.
Open

                        return results;
Severity: Major
Found in app/assets/javascripts/jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return results;
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return 1;
      Severity: Major
      Found in app/assets/javascripts/jquery.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return i === al ?
                    siblingCheck( a, bp[i], -1 ) :
                    siblingCheck( ap[i], b, 1 );
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return value;
          Severity: Major
          Found in app/assets/javascripts/jquery.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return ret === null ?
                            undefined :
                            ret;
            Severity: Major
            Found in app/assets/javascripts/jquery.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return siblingCheck( ap[i], bp[i] );
              Severity: Major
              Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                Method subject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def subject
                    return unless %w(edit show view index).include?(action_name)
                    return unless instance = controller.instance_variable_get("@#{controller_name.singularize}")
                    return unless instance.respond_to?(:name)
                    instance.name
                Severity: Minor
                Found in app/helpers/application_helper.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

                Method compile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def compile(program)
                    raise CompileError.new("Compiler or Interpreter needs") if invalid?
                    raise CompileError.new("Language is not supported") unless active
                
                    return exe(program) if interpreted? # no need to compile
                Severity: Minor
                Found in app/models/language.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

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

                  def initialize(user)
                    can :read, Contest
                
                    can :read, Problem do |problem|
                      problem.publicized? || user.owns?(problem)
                Severity: Minor
                Found in app/abilities/coder_ability.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

                Method flashy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def flashy
                    message, css = nil, nil
                
                    if msg = flash[:notice] || params[:notice]
                      message, css = msg, 'alert-success'
                Severity: Minor
                Found in app/helpers/application_helper.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

                Severity
                Category
                Status
                Source
                Language