CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

        [HttpGet]
        [OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
        public JsonResult Participant(Guid participantId)
        {
            Response.AppendHeader("Access-Control-Allow-Origin", "*");
Severity: Major
Found in Web.Admin/Controllers/ScoresController.cs and 2 other locations - About 1 hr to fix
Web.Admin/Controllers/ScoresController.cs on lines 51..59
Web.Admin/Controllers/ScoresController.cs on lines 71..79

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

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

                                    , callback: _wrap(function _(err, base64){
                                        api.log('FlashAPI.Image._apply.callback:', err);
                                        _unwrap(_);

                                        if( err ){
Severity: Minor
Found in Web.Admin/z-scripts/FileAPI.js - About 1 hr to fix

    Function lazyLoadChunks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        lazyLoadChunks: function( size, delay ) {
    
            var len = this.getDataLength(),
                i = 0,
                n = 0,
    Severity: Minor
    Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 1 hr to fix

      Function trackPageViewInternal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  AppInsights.prototype.trackPageViewInternal = function (name, url, properties, measurements) {
                      var _this = this;
                      var durationMs = 0;
                      if (ApplicationInsights.Telemetry.PageViewPerformance.isPerformanceTimingSupported()) {
                          var startTime = window.performance.timing.navigationStart;
      Severity: Minor
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js - About 1 hr to fix

        Function decrementCount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            wp.updates.decrementCount = function( upgradeType ) {
                var count, pluginCount, $elem;
        
                $elem = $( '#wp-admin-bar-updates .ab-label' );
                count = $elem.text();
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/js/updates.js - About 1 hr to fix

          Function _audioVideo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _audioVideo: function( type, props, attachment ) {
                      var shortcode, html, extension;
          
                      props = wp.media.string.props( props, attachment );
                      if ( props.link !== 'embed' )
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 1 hr to fix

            Function _wp_Nop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _wp_Nop : function(content) {
                    var blocklist1, blocklist2;
            
                    // Protect pre|script tags
                    content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/js/editor.dev.js - About 1 hr to fix

              Function save has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  save : function(postid, nonce) {
                      var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
              
                      if ( '' == history )
                          return false;
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-admin/js/image-edit.dev.js - About 1 hr to fix

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

                        slide: function( event, ui ) {
                            var attributes, movedRevision;
                            // Compare two revisions mode
                            if ( this.model.get('compareTwoMode') ) {
                                // Prevent sliders from occupying same spot
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-admin/js/revisions.js - About 1 hr to fix

                  Function insert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          insert: function( html ) {
                              var editor,
                                  hasTinymce = ! _.isUndefined( window.tinymce ),
                                  hasQuicktags = ! _.isUndefined( window.QTags ),
                                  wpActiveEditor = window.wpActiveEditor;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/media-editor.js - About 1 hr to fix

                    Function clean has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        jQuery.clean = function( elems, context, fragment, scripts ) {
                            // Set context per 1.8 logic
                            context = context || document;
                            context = !context.nodeType && context[0] || context;
                            context = context.ownerDocument || context;
                    Severity: Minor
                    Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery-migrate.js - About 1 hr to fix

                      Function PopupWindow_refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function PopupWindow_refresh() {
                          if (this.divName != null) {
                              // refresh the DIV object
                              if (this.use_gebi) {
                                  document.getElementById(this.divName).innerHTML = this.contents;
                      Severity: Minor
                      Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 1 hr to fix

                        Function add has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this.add = function(callback, scope, prepend) {
                                    log('<target>.on' + newEventName + ".add(..)");
                        
                                    // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
                                    function patchedEventCallback(e) {

                          Function removeWebKitStyles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function removeWebKitStyles(content) {
                                      // Passthrough all styles from Word and let the WordFilter handle that junk
                                      if (WordFilter.isWordContent(content)) {
                                          return content;
                                      }

                            Function renderUI has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                self.renderUI = function(args) {
                                    var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
                            
                                    if (skin) {
                                        var skinUrl = settings.skin_url;

                              Function setupBDDExtensionMethods has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              Test.setupBDDExtensionMethods = function(){
                                var METHODMAP = {
                                  shouldEqual:     'assertEqual',
                                  shouldNotEqual:  'assertNotEqual',
                                  shouldEqualEnum: 'assertEnumEqual',
                              Severity: Minor
                              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js - About 1 hr to fix

                                Function setErrorState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function setErrorState( error, status ) {
                                            var trigger;
                                
                                            if ( error ) {
                                                switch ( error ) {
                                Severity: Minor
                                Found in Web.Admin/2014/wordpress/wp-includes/js/heartbeat.js - About 1 hr to fix

                                  Function simulateMouse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Event.simulateMouse = function(element, eventName) {
                                    var options = Object.extend({
                                      pointerX: 0,
                                      pointerY: 0,
                                      buttons:  0,
                                  Severity: Minor
                                  Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js - About 1 hr to fix

                                    Function open has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            open: function( editorId ) {
                                                var ed;
                                                
                                                wpLink.range = null;
                                    
                                    
                                    Severity: Minor
                                    Found in Web.Admin/2014/wordpress/wp-includes/js/wplink.js - About 1 hr to fix

                                      Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      module.exports = function (config) {
                                        config.set({
                                          basePath: '',
                                          frameworks: ['jasmine', '@angular-devkit/build-angular'],
                                          plugins: [
                                      Severity: Minor
                                      Found in Website/karma.conf.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language