angelakuo/citydogshare

View on GitHub

Showing 3,976 of 3,976 total issues

Function toHaveBeenCalled has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

getJasmineRequireObj().toHaveBeenCalled = function(j$) {

  var getErrorMsg = j$.formatErrorMsg('<toHaveBeenCalled>', 'expect(<spyObj>).toHaveBeenCalled()');

  function toHaveBeenCalled() {

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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    @event = Event.find(params[:id])
    if not @is_admin and @event.user != @current_user
      flash[:notice] = "You may not edit another person's event."
      redirect_to events_path
Severity: Minor
Found in app/controllers/events_controller.rb - About 55 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {

    Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {

      Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

        Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {

          Function createDate has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function createDate (y, m, d, h, M, s, ms) {

            Function createDate has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function createDate (y, m, d, h, M, s, ms) {

              Block has too many lines. [31/25]
              Open

              Citydogshare::Application.configure do
                # Settings specified here will take precedence over those in config/application.rb
                
                config.eager_load = false
                # The test environment is used exclusively to run your application's
              Severity: Minor
              Found in config/environments/test.rb 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 deeply nested control flow statements.
              Open

                                      if ( (elem = matcherOut[i]) ) {
                                          // Restore matcherIn since elem is not yet a final match
                                          temp.push( (matcherIn[i] = elem) );
                                      }

                Avoid deeply nested control flow statements.
                Open

                                    if ( !selector ) {
                                        push.apply( results, seed );
                                        return results;
                                    }

                  Avoid deeply nested control flow statements.
                  Open

                                          if ( ( event.result = ret ) === false ) {
                                              event.preventDefault();
                                              event.stopPropagation();
                                          }

                    Avoid deeply nested control flow statements.
                    Open

                                    } else if ( copy !== undefined ) {
                                        target[ name ] = copy;
                                    }

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                                  cur += clazz + " ";
                                              }

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( rscriptType.test( node.type || "" ) &&
                                                !dataPriv.access( node, "globalEval" ) &&
                                                jQuery.contains( doc, node ) ) {
                        
                                                if ( node.src ) {

                          Function mutateEvents has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) {

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ( ( ofType ?
                                                                    node.nodeName.toLowerCase() === name :
                                                                    node.nodeType === 1 ) &&
                                                                    ++diff ) {
                            
                            

                              Avoid deeply nested control flow statements.
                              Open

                                                      for ( match in context ) {
                              
                                                          // Properties of context are called as methods if possible
                                                          if ( jQuery.isFunction( this[ match ] ) ) {
                                                              this[ match ]( context[ match ] );

                                Avoid deeply nested control flow statements.
                                Open

                                                    if ( conv && s.throws ) {
                                                        response = conv( response );
                                                    } else {
                                                        try {
                                                            response = conv( response );

                                  Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language