rosedu/wouso

View on GitHub

Showing 2,707 of 2,707 total issues

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

    @unittest.skip
    def test_5_players(self):
        self._simulate_n_users(5)
        self.assertEqual(GrandChallengeGame.get_winner().id, self._get_player(1).id)
Severity: Major
Found in wouso/games/grandchallenge/tests.py and 4 other locations - About 1 hr to fix
wouso/games/grandchallenge/tests.py on lines 47..50
wouso/games/grandchallenge/tests.py on lines 57..60
wouso/games/grandchallenge/tests.py on lines 62..65
wouso/games/grandchallenge/tests.py on lines 67..70

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

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

var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
    var i = 0,
        length = elems.length,
        bulk = key == null;

Severity: Minor
Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

    Function dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        dispatch: function( event ) {
    
            // Make a writable jQuery.Event from the native event object
            event = jQuery.event.fix( event );
    
    
    Severity: Minor
    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

      Function showHide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function showHide( elements, show ) {
          var display, elem, hidden,
              values = [],
              index = 0,
              length = elements.length;
      Severity: Minor
      Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

        Function clone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                var destElements, node, clone, i, srcElements,
                    inPage = jQuery.contains( elem.ownerDocument, elem );
        
                if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
        Severity: Minor
        Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

          Function dispatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              dispatch: function( event ) {
          
                  // Make a writable jQuery.Event from the native event object
                  event = jQuery.event.fix( event );
          
          
          Severity: Minor
          Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

            Function clone has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                    var destElements, node, clone, i, srcElements,
                        inPage = jQuery.contains( elem.ownerDocument, elem );
            
                    if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
            Severity: Minor
            Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

              Function access has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
                  var i = 0,
                      length = elems.length,
                      bulk = key == null;
              
              
              Severity: Minor
              Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

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

                        add: function(element, interval, label, fn, times, belay) {
                            var counter = 0;
                            
                            if (jQuery.isFunction(label)) {
                                if (!times) 
                Severity: Minor
                Found in wouso/resources/static/js/jquery.timers.js - About 1 hr to fix

                  Function showHide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function showHide( elements, show ) {
                      var display, elem, hidden,
                          values = [],
                          index = 0,
                          length = elements.length;
                  Severity: Minor
                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                    Function style has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        style: function( elem, name, value, extra ) {
                            // Don't set styles on text and comment nodes
                            if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                return;
                            }
                    Severity: Minor
                    Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                      Function fieldValue has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      $.fieldValue = function(el, successful) {
                          var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
                          if (successful === undefined) {
                              successful = true;
                          }
                      Severity: Minor
                      Found in wouso/resources/static/js/jquery.form.js - About 1 hr to fix

                        Function show has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Modal.prototype.show = function (_relatedTarget) {
                            var that = this
                            var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
                        
                            this.$element.trigger(e)
                        Severity: Minor
                        Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

                          Function backdrop has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            Modal.prototype.backdrop = function (callback) {
                              var that = this
                              var animate = this.$element.hasClass('fade') ? 'fade' : ''
                          
                              if (this.isShown && this.options.backdrop) {
                          Severity: Minor
                          Found in wouso/resources/static/js/bootstrap.js - About 1 hr to fix

                            Function cleanData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                cleanData: function( elems, /* internal */ acceptData ) {
                                    var elem, type, id, data,
                                        i = 0,
                                        internalKey = jQuery.expando,
                                        cache = jQuery.cache,
                            Severity: Minor
                            Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                              Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  setOffset: function( elem, options, i ) {
                                      var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                                          position = jQuery.css( elem, "position" ),
                                          curElem = jQuery( elem ),
                                          props = {};
                              Severity: Minor
                              Found in wouso/resources/static/js/jquery.js - About 1 hr to fix

                                Function style has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    style: function( elem, name, value, extra ) {
                                        // Don't set styles on text and comment nodes
                                        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                            return;
                                        }
                                Severity: Minor
                                Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                                  Function cleanData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      cleanData: function( elems, /* internal */ acceptData ) {
                                          var elem, type, id, data,
                                              i = 0,
                                              internalKey = jQuery.expando,
                                              cache = jQuery.cache,
                                  Severity: Minor
                                  Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                                    Function setOffset has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        setOffset: function( elem, options, i ) {
                                            var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                                                position = jQuery.css( elem, "position" ),
                                                curElem = jQuery( elem ),
                                                props = {};
                                    Severity: Minor
                                    Found in wouso/resources/static/js/jquery-1.11.1.min.js - About 1 hr to fix

                                      Function extra_stats has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      def extra_stats(request):
                                          """
                                          Generate extra statistics, dump them as JSON
                                      
                                          * Numărul de jucători care au accesat în 95% din zile site-ul
                                      Severity: Minor
                                      Found in wouso/interface/apps/statistics/views.py - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language