pjambet/beech-server

View on GitHub

Showing 166 of 166 total issues

Consider simplifying this complex logical expression.
Open

        if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
            return;
        }
Severity: Major
Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 1 hr to fix

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

          content = $e.attr('data-content')
            || (typeof o.content == 'function' ? o.content.call($e[0]) :  o.content)
    Severity: Major
    Found in doc/apidoc/javascripts/bundled/bootstrap.js and 1 other location - About 1 hr to fix
    doc/apidoc/javascripts/bundled/bootstrap.js on lines 1045..1046

    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 55.

    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

          title = $e.attr('data-original-title')
            || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
    Severity: Major
    Found in doc/apidoc/javascripts/bundled/bootstrap.js and 1 other location - About 1 hr to fix
    doc/apidoc/javascripts/bundled/bootstrap.js on lines 1164..1165

    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 55.

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

      def update
        self.resource = resource_class.reset_password_by_token(resource_params)
    
        if resource.errors.empty?
          resource.unlock_access! if unlockable?(resource)
    Severity: Minor
    Found in app/controllers/users/passwords_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

        access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
    Severity: Major
    Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( elem && elem.parentNode ) {
                                  // Handle the case where IE and Opera return items
                                  // by name instead of ID
                                  if ( elem.id === match[3] ) {
                                      return makeArray( [ elem ], extra );
      Severity: Major
      Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( !relativeHierarchySelector || hasParent ) {
                                    return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
                                }
        Severity: Major
        Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if ( xml && xml.documentElement /* #4958 */ ) {
                                                  responses.xml = xml;
                                              }
          Severity: Major
          Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for ( c = 0, cl = classNames.length; c < cl; c++ ) {
                                        className = className.replace(" " + classNames[ c ] + " ", " ");
                                    }
            Severity: Major
            Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

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

                      CLASS: function( match, curLoop, inplace, result, not, isXML ) {
              Severity: Minor
              Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if ( firing ) {
                                                    if ( i <= firingLength ) {
                                                        firingLength--;
                                                        if ( i <= firingIndex ) {
                                                            firingIndex--;
                Severity: Major
                Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ( !old ) {
                                          context.setAttribute( "id", nid );
                                      } else {
                                          nid = nid.replace( /'/g, "\\$&" );
                                      }
                  Severity: Major
                  Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

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

                    function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
                    Severity: Minor
                    Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if ( copyIsArray ) {
                                              copyIsArray = false;
                                              clone = src && jQuery.isArray(src) ? src : [];
                      
                                          } else {
                      Severity: Major
                      Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            for ( i = 0; (item = curLoop[i]) != null; i++ ) {
                                                if ( item ) {
                                                    found = filter( item, match, i, curLoop );
                                                    pass = not ^ found;
                        
                        
                        Severity: Major
                        Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ( special[ type ] ) {
                                                      jQuery.event.remove( elem, type );
                          
                                                  // This is a shortcut to avoid jQuery.event.remove's overhead
                                                  } else {
                          Severity: Major
                          Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if ( !xhrCallbacks ) {
                                                            xhrCallbacks = {};
                                                            jQuery( window ).unload( xhrOnUnloadAbort );
                                                        }
                            Severity: Major
                            Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ( selMatch[ sel ] === undefined ) {
                                                          selMatch[ sel ] = (
                                                              handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
                                                          );
                                                      }
                              Severity: Major
                              Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ( !old ) {
                                                            oldContext.removeAttribute( "id" );
                                                        }
                                Severity: Major
                                Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if ( typeof cur !== "string" ) {
                                                          if ( elem === cur ) {
                                                              match = true;
                                                              break;
                                                          }
                                  Severity: Major
                                  Found in doc/apidoc/javascripts/bundled/jquery-1.7.2.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language