CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
    $bookmark = (int) $bookmark;
    $bookmark = get_bookmark( $bookmark );

    if ( is_wp_error($bookmark) )
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/bookmark.php and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/post.php on lines 318..332

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

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

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

        if ( navigator.userAgent && document.body.className.indexOf( 'no-font-face' ) === -1 &&
            /Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test( navigator.userAgent ) ) {

            document.body.className += ' no-font-face';
        }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/admin-bar.js and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/js/admin-bar.js on lines 357..361

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

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

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

            if ( navigator.userAgent && document.body.className.indexOf( 'no-font-face' ) === -1 &&
                /Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test( navigator.userAgent ) ) {

                document.body.className += ' no-font-face';
            }
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/admin-bar.js and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/js/admin-bar.js on lines 158..162

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

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

            this.setPrimaryButton( l10n.replace, function( controller, state ) {
                var attachment = state.get( 'selection' ).single();
                controller.media.changeAttachment( attachment );
                state.trigger( 'replace', controller.media.toJSON() );
            } );
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 506..510

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

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

            this.setPrimaryButton( this.addText, function( controller, state ) {
                var attachment = state.get( 'selection' ).single();
                controller.media.setSource( attachment );
                state.trigger( 'add-source', controller.media.toJSON() );
            } );
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 1 hr to fix
Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 498..502

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

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 ArrayType has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function ArrayType(type, mode) {
    function bindTo(type, callbackName) {
      return function() {
        return type[callbackName].apply(type, arguments);
      };
Severity: Minor
Found in Web.Admin/z-scripts/angular-ui-router.js - About 1 hr to fix

    Function load has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Galleria.prototype.load = function() {
    
        // pass if no data is provided or flickr option not found
        if ( arguments.length || typeof this._options.flickr !== 'string' ) {
            load.apply( this, Galleria.utils.array( arguments ) );
    Severity: Minor
    Found in Web.Admin/2015/js/galleria/plugins/flickr/galleria.flickr.js - About 1 hr to fix

      Function practiceController has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var practiceController = function ($scope, $http, $q, $location, dataService) {
              var url = $location.absUrl();
              var lastSlash = url.lastIndexOf('/');
              var province = url.slice(lastSlash + 1);
              var year = url.slice(lastSlash - 4, lastSlash);
      Severity: Minor
      Found in Web.Admin/AdminApp/Controllers/controller.practice.js - About 1 hr to fix

        Function editDivisions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function editDivisions(teams) {
                    var modalPromise = modalFactory.Divisions(teams);
        
                    modalPromise.then(function (data) {
                        //var currentTeams = $scope.model.Teams;
        Severity: Minor
        Found in Web.Admin/AdminApp/Controllers/controller.contingent.js - About 1 hr to fix

          Function centresController has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var centresController = function ($http, $q, $location, dataService) {
                  var url = $location.absUrl();
                  var lastSlash = url.lastIndexOf('/');
                  var year = url.slice(lastSlash + 1);
          
          
          Severity: Minor
          Found in Web.Admin/AdminApp/Controllers/controller.centres.js - About 1 hr to fix

            Function paintElement has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    paintElement: function( $element, colorType ) {
                        var xml, encoded, color;
            
                        if ( ! colorType || ! colorscheme.hasOwnProperty( colorType ) ) {
                            return;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/js/svg-painter.js - About 1 hr to fix

              Function initialize has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initialize: function( options ) {
                      var self = this;
              
                      // Set up parent
                      this.parent = options.parent;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/js/theme.js - About 1 hr to fix

                Function cb has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function cb() {
                            if (cbInvoked++) return;
                
                            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
                
                
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery.form.dev.js - About 1 hr to fix

                  Function setOptions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    setOptions: function(options) {
                      this.options = Object.extend({
                        choices: 10,
                        partialSearch: true,
                        partialChars: 2,
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/controls.js - About 1 hr to fix

                    Function load has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Galleria.prototype.load = function() {
                    
                        // pass if no data is provided or flickr option not found
                        if ( arguments.length || typeof this._options.flickr !== 'string' ) {
                            load.apply( this, Galleria.utils.array( arguments ) );
                    Severity: Minor
                    Found in Web.Admin/Content/galleria/plugins/flickr/galleria.flickr.js - About 1 hr to fix

                      Function render has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              render: function() {
                                  var options = _.defaults( this.model.toJSON(), {
                                          orientation:   'landscape',
                                          uploading:     false,
                                          type:          '',
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/js/media-views.js - About 1 hr to fix

                        Method PclZipUtilPathReduction has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function PclZipUtilPathReduction($p_dir)
                          {
                            $v_result = "";
                        
                            // ----- Look for not empty path
                        Severity: Minor
                        Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 1 hr to fix

                          Method privExtractFileUsingTempFile has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function privExtractFileUsingTempFile(&$p_entry, &$p_options)
                            {
                              $v_result=1;
                          
                              // ----- Creates a temporary file
                          Severity: Minor
                          Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 1 hr to fix

                            Method PclZipUtilPathInclusion has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function PclZipUtilPathInclusion($p_dir, $p_path)
                              {
                                $v_result = 1;
                            
                                // ----- Look for path beginning by ./
                            Severity: Minor
                            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 1 hr to fix

                              Method wp_iframe has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function wp_iframe($content_func /* ... */) {
                              ?>
                              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                              <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
                              <head>
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-admin/includes/media.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language