CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

            const upperProfileRoles = [].concat.apply([], profileRoles || []).filter(x => !!x).map(x => x.toUpperCase());
Severity: Major
Found in Website/src/app/services/auth-guard.service.ts and 1 other location - About 1 hr to fix
Website/src/app/services/auth-guard.service.ts on lines 22..22

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

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

            const upperRouteRoles = [].concat.apply([], routeRoles || []).filter(x => !!x).map(x => x.toUpperCase());
Severity: Major
Found in Website/src/app/services/auth-guard.service.ts and 1 other location - About 1 hr to fix
Website/src/app/services/auth-guard.service.ts on lines 21..21

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

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

Consider simplifying this complex logical expression.
Open

            if ( result.edge == 'top' || result.edge == 'bottom' ) {
                result.align = result.align || 'left';

                result.at = result.at || result.align + ' ' + opposite[ result.edge ];
                result.my = result.my || result.align + ' ' + result.edge;
Severity: Critical
Found in Web.Admin/2014/wordpress/wp-includes/js/wp-pointer.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) ||
                (k.ctrl == 'resize' && event.ctrlKey) ||
                (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey)))
            {
                switch (key) {

      Consider simplifying this complex logical expression.
      Open

              if (this.popupWindow == null || this.popupWindow.closed) {
                  // If the popup window will go off-screen, move it so it doesn't
                  if (this.x<0) { this.x=0; }
                  if (this.y<0) { this.y=0; }
                  if (screen && screen.availHeight) {
      Severity: Critical
      Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                    if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {
                        // On the non-network screen, filter out network-only plugins as long as they're not individually activated
                        unset( $plugins['all'][ $plugin_file ] );
                    } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
                        // On the non-network screen, filter out network activated plugins

          Consider simplifying this complex logical expression.
          Open

                              if (
                                  ! empty( $menu_item_data['menu_item_parent'] ) &&
                                  in_array( $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ) ) &&
                                  isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) &&
                                  ( $menu_item_data['menu_item_parent'] == $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] )
          Severity: Critical
          Found in Web.Admin/2014/wordpress/wp-admin/nav-menus.php - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if ( ! empty( $current_object->post_type )
                        && ( $post_type_object = get_post_type_object( $current_object->post_type ) )
                        && current_user_can( 'edit_post', $current_object->ID )
                        && $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
                    {
            Severity: Critical
            Found in Web.Admin/2014/wordpress/wp-includes/admin-bar.php - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if ($this->ipath !== '' &&
                          (
                              $isauthority && (
                                  $this->ipath[0] !== '/' ||
                                  substr($this->ipath, 0, 2) === '//'
              Severity: Critical
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/IRI.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
                            || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml'))
                            {
                                $this->current_xhtml_construct = 0;
                            }
                Severity: Critical
                Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                              if ( !empty($this->query_vars['withcomments'])
                                  || ( empty($this->query_vars['withoutcomments'])
                                      && ( !empty($this->query_vars['p'])
                                          || !empty($this->query_vars['name'])
                                          || !empty($this->query_vars['page_id'])
                  Severity: Critical
                  Found in Web.Admin/2014/wordpress/wp-includes/classes.php - About 1 hr to fix

                    Function _convertFile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function _convertFile(file, fn, useBinaryString){
                            var blob = file.blob, filename = file.file;
                    
                            if( filename ){
                                if( !blob.toDataURL ){
                    Severity: Minor
                    Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

                      Function _getFilesDataArray has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  _getFilesDataArray: function (data){
                                      var files = [], oFiles = {};
                      
                                      if( isInputFile(data) ){
                                          var tmp = api.getFiles(data);
                      Severity: Minor
                      Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

                        Function controller has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
                              var states = [], activeClass;
                        
                              // There probably isn't much point in $observing this
                              // uiSrefActive and uiSrefActiveEq share the same directive object with some
                        Severity: Minor
                        Found in Web.Admin/z-scripts/angular-ui-router.js - About 1 hr to fix

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

                                      load: function (url, fn){
                                          var xhr = api.getXHR();
                                          if( xhr ){
                                              xhr.open('GET', url, true);
                          
                          
                          Severity: Minor
                          Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

                            Function transition has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  var transition = $state.transition = resolved.then(function () {
                                    var l, entering, exiting;
                            
                                    if ($state.transition !== transition) return TransitionSuperseded;
                            
                            
                            Severity: Minor
                            Found in Web.Admin/z-scripts/angular-ui-router.js - About 1 hr to fix

                              Function resolveState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {
                                    // Make a restricted $stateParams with only the parameters that apply to this state if
                                    // necessary. In addition to being available to the controller and onEnter/onExit callbacks,
                                    // we also need $stateParams to be available for any $injector calls we make during the
                                    // dependency resolution process.
                              Severity: Minor
                              Found in Web.Admin/z-scripts/angular-ui-router.js - About 1 hr to fix

                                Function loop has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        loop: function() {
                                
                                            var distance = this.to - this.pos,
                                                factor = 1;
                                
                                
                                Severity: Minor
                                Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

                                  Function complete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                      complete: function( thumb ) {
                                  
                                                          // shrink thumbnails to fit
                                                          var top = ['left', 'top'],
                                                              arr = ['Width', 'Height'],
                                  Severity: Minor
                                  Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

                                    Function _track has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                TelemetryContext.prototype._track = function (envelope) {
                                                    if (this.session) {
                                                        if (typeof this.session.id === "string") {
                                                            this._applySessionContext(envelope, this.session);
                                                        }
                                    Severity: Minor
                                    Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language