klein0r/affiliate-dashboard

View on GitHub

Showing 320 of 320 total issues

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

    public function newAction(Request $request)
    {
        $user = new User();
        $form = $this->createForm('AffiliateDashboardBundle\Form\UserType', $user);
        $form->handleRequest($request);
Severity: Major
Found in src/AffiliateDashboardBundle/Controller/UserController.php and 1 other location - About 2 hrs to fix
src/AffiliateDashboardBundle/Controller/TagController.php on lines 42..60

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

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

    public function newAction(Request $request)
    {
        $tag = new Tag();
        $form = $this->createForm('AffiliateDashboardBundle\Form\TagType', $tag);
        $form->handleRequest($request);
Severity: Major
Found in src/AffiliateDashboardBundle/Controller/TagController.php and 1 other location - About 2 hrs to fix
src/AffiliateDashboardBundle/Controller/UserController.php on lines 42..60

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

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

Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    remove: function( elem, types, handler, selector, mappedTypes ) {
        var j, handleObj, tmp,
            origCount, t, events,
            special, handlers, type,
            namespaces, origType,
Severity: Major
Found in web/js/jquery.js - About 2 hrs to fix

    Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        remove: function( elem, types, handler, selector, mappedTypes ) {
            var j, handleObj, tmp,
                origCount, t, events,
                special, handlers, type,
                namespaces, origType,
    Severity: Major
    Found in web/js/jquery_jquery-1.11.1_1.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                      if ( ( mappedTypes || origType === handleObj.origType ) &&
                          ( !handler || handler.guid === handleObj.guid ) &&
                          ( !tmp || tmp.test( handleObj.namespace ) ) &&
                          ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                          handlers.splice( j, 1 );
      Severity: Critical
      Found in web/js/jquery.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                        if ( ( mappedTypes || origType === handleObj.origType ) &&
                            ( !handler || handler.guid === handleObj.guid ) &&
                            ( !tmp || tmp.test( handleObj.namespace ) ) &&
                            ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                            handlers.splice( j, 1 );
        Severity: Critical
        Found in web/js/jquery_jquery-1.11.1_1.js - About 2 hrs to fix

          Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function internalRemoveData( elem, name, pvt ) {
              if ( !jQuery.acceptData( elem ) ) {
                  return;
              }
          
          
          Severity: Minor
          Found in web/js/jquery.js - About 1 hr to fix

            Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function internalRemoveData( elem, name, pvt ) {
                if ( !jQuery.acceptData( elem ) ) {
                    return;
                }
            
            
            Severity: Minor
            Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix

              Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              select = Sizzle.select = function( selector, context, results, seed ) {
                  var i, tokens, token, type, find,
                      compiled = typeof selector === "function" && selector,
                      match = !seed && tokenize( (selector = compiled.selector || selector) );
              
              
              Severity: Minor
              Found in web/js/jquery.js - About 1 hr to fix

                Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                    if ( !jQuery.acceptData( elem ) ) {
                        return;
                    }
                
                
                Severity: Minor
                Found in web/js/jquery.js - About 1 hr to fix

                  Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  select = Sizzle.select = function( selector, context, results, seed ) {
                      var i, tokens, token, type, find,
                          compiled = typeof selector === "function" && selector,
                          match = !seed && tokenize( (selector = compiled.selector || selector) );
                  
                  
                  Severity: Minor
                  Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix

                    Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                        if ( !jQuery.acceptData( elem ) ) {
                            return;
                        }
                    
                    
                    Severity: Minor
                    Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix

                      Function slide has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Carousel.prototype.slide = function (type, next) {
                          var $active   = this.$element.find('.item.active')
                          var $next     = next || $active[type]()
                          var isCycling = this.interval
                          var direction = type == 'next' ? 'left' : 'right'
                      Severity: Minor
                      Found in web/js/bootstrap_carousel_4.js - About 1 hr to fix

                        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                            var matched, match, tokens, type,
                                soFar, groups, preFilters,
                                cached = tokenCache[ selector + " " ];
                        
                        
                        Severity: Minor
                        Found in web/js/jquery.js - About 1 hr to fix

                          Function slide has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            Carousel.prototype.slide = function (type, next) {
                              var $active   = this.$element.find('.item.active')
                              var $next     = next || $active[type]()
                              var isCycling = this.interval
                              var direction = type == 'next' ? 'left' : 'right'
                          Severity: Minor
                          Found in web/js/bootstrap.js - About 1 hr to fix

                            Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                                var matched, match, tokens, type,
                                    soFar, groups, preFilters,
                                    cached = tokenCache[ selector + " " ];
                            
                            
                            Severity: Minor
                            Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix

                              Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function matcherFromTokens( tokens ) {
                                  var checkContext, matcher, j,
                                      len = tokens.length,
                                      leadingRelative = Expr.relative[ tokens[0].type ],
                                      implicitRelative = leadingRelative || Expr.relative[" "],
                              Severity: Minor
                              Found in web/js/jquery.js - About 1 hr to fix

                                Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function matcherFromTokens( tokens ) {
                                    var checkContext, matcher, j,
                                        len = tokens.length,
                                        leadingRelative = Expr.relative[ tokens[0].type ],
                                        implicitRelative = leadingRelative || Expr.relative[" "],
                                Severity: Minor
                                Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                                  ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                                  ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                                  !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                                  
                                  
                                  Severity: Critical
                                  Found in web/js/jquery.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                                    ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                                    ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                                    !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                                    
                                    
                                    Severity: Critical
                                    Found in web/js/jquery_jquery-1.11.1_1.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language