bronycub/sugarcub

View on GitHub

Showing 3,238 of 3,238 total issues

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

        } else {
            el.style.left = point.x + 'px';
            el.style.top = point.y + 'px';
        }
Severity: Minor
Found in core/static/vendor/leaflet/dist/leaflet-src.js and 1 other location - About 40 mins to fix
core/static/vendor/leaflet/dist/leaflet-src.js on lines 3362..3365

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

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

                    window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
Severity: Minor
Found in core/static/vendor/bootstrap-datepicker/tests/assets/qunit.js and 1 other location - About 40 mins to fix
core/static/vendor/bootstrap-datepicker/tests/assets/qunit.js on lines 198..198

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

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 (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
            (milliseconds <= 0 && days <= 0 && months <= 0))) {
        milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
        days = 0;
        months = 0;
Severity: Major
Found in core/static/vendor/moment/src/lib/duration/bubble.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
                (milliseconds <= 0 && days <= 0 && months <= 0))) {
            milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
            days = 0;
            months = 0;
    Severity: Major
    Found in core/static/vendor/moment/moment.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
                  (milliseconds <= 0 && days <= 0 && months <= 0))) {
              milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
              days = 0;
              months = 0;
      Severity: Major
      Found in core/static/vendor/moment/min/moment-with-locales.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if ( matcher[ expando ] ) {
                        // Find the next relative operator (if any) for proper handling
                        j = ++i;
                        for ( ; j < len; j++ ) {
                            if ( Expr.relative[ tokens[j].type ] ) {
        Severity: Major
        Found in core/static/vendor/jquery/dist/jquery.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                          context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
          
                      context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                      if ( !context ) {
          Severity: Major
          Found in core/static/vendor/jquery/dist/jquery.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                            context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
            
                        context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                        if ( !context ) {
            Severity: Major
            Found in core/static/vendor/jquery/dist/jquery.slim.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                          if ( matcher[ expando ] ) {
                              // Find the next relative operator (if any) for proper handling
                              j = ++i;
                              for ( ; j < len; j++ ) {
                                  if ( Expr.relative[ tokens[j].type ] ) {
              Severity: Major
              Found in core/static/vendor/jquery/dist/jquery.slim.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                            if ( matcher[ expando ] ) {
                                // Find the next relative operator (if any) for proper handling
                                j = ++i;
                                for ( ; j < len; j++ ) {
                                    if ( Expr.relative[ tokens[j].type ] ) {
                Severity: Major
                Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                  context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
                  
                              context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                              if ( !context ) {
                  Severity: Major
                  Found in core/static/vendor/jquery/external/sizzle/dist/sizzle.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                                } else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
                                                    classes.push('xdsoft_disabled');
                                                } else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
                                                    classes.push('xdsoft_disabled');
                                                } else if (options.disabledWeekDays.indexOf(day) !== -1) {
                    Severity: Major
                    Found in core/static/vendor/datetimepicker/build/jquery.datetimepicker.full.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                                  } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
                                                      classes.push('xdsoft_disabled');
                                                  } else if (input.is('[readonly]')) {
                                                      classes.push('xdsoft_disabled');
                                                  }
                      Severity: Major
                      Found in core/static/vendor/datetimepicker/jquery.datetimepicker.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                                    } else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
                                                        classes.push('xdsoft_disabled');
                                                    } else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
                                                        classes.push('xdsoft_disabled');
                                                    } else if (options.disabledWeekDays.indexOf(day) !== -1) {
                        Severity: Major
                        Found in core/static/vendor/datetimepicker/jquery.datetimepicker.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                      if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
                                                          classes.push('xdsoft_disabled');
                                                      } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
                                                          classes.push('xdsoft_disabled');
                                                      } else if (input.is('[readonly]')) {
                          Severity: Major
                          Found in core/static/vendor/datetimepicker/jquery.datetimepicker.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                        } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
                                                            classes.push('xdsoft_disabled');
                                                        } else if (input.is('[readonly]')) {
                                                            classes.push('xdsoft_disabled');
                                                        }
                            Severity: Major
                            Found in core/static/vendor/datetimepicker/build/jquery.datetimepicker.full.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                                                  if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
                                                                      $(this).val([splittedHours, splittedMinutes].map(function (item) {
                                                                          return item > 9 ? item : '0' + item;
                                                                      }).join(':'));
                                                                  } else {
                              Severity: Major
                              Found in core/static/vendor/datetimepicker/jquery.datetimepicker.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                            if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
                                                                classes.push('xdsoft_disabled');
                                                            } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
                                                                classes.push('xdsoft_disabled');
                                                            } else if (input.is('[readonly]')) {
                                Severity: Major
                                Found in core/static/vendor/datetimepicker/build/jquery.datetimepicker.full.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                                      if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
                                                                          $(this).val([splittedHours, splittedMinutes].map(function (item) {
                                                                              return item > 9 ? item : '0' + item;
                                                                          }).join(':'));
                                                                      } else {
                                  Severity: Major
                                  Found in core/static/vendor/datetimepicker/build/jquery.datetimepicker.full.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                      if ( support.matchesSelector && documentIsHTML &&
                                        ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                                        ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                                    
                                        try {
                                    Severity: Major
                                    Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 40 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language