ZuluPro/myblog

View on GitHub
myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js

Summary

Maintainability
D
2 days
Test Coverage

File foundation.clearing.js has 433 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function ($, window, document, undefined) {
  'use strict';

  Foundation.libs.clearing = {
    name : 'clearing',
Severity: Minor
Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 6 hrs to fix

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

        open : function ($image, current, target) {
          var self = this,
              body = $(document.body),
              root = target.closest('.clearing-assembled'),
              container = self.S('div', root).first(),
    Severity: Minor
    Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 1 hr to fix

      Function swipe_events has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          swipe_events : function (scope) {
            var self = this,
            S = self.S;
      
            S(this.scope)
      Severity: Minor
      Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 1 hr to fix

        Function events has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            events : function (scope) {
              var self = this,
                  S = self.S,
                  $scroll_container = $('.scroll-container');
        
        
        Severity: Minor
        Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 1 hr to fix

          Function shift has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              shift : function (current, target, callback) {
                var clearing = target.parent(),
                    old_index = this.settings.prev_index || target.index(),
                    direction = this.direction(clearing, current, target),
                    dir = this.rtl ? 'right' : 'left',
          Severity: Minor
          Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 1 hr to fix

            Function center_and_label has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                center_and_label : function (target, label) {
                  if (!this.rtl) {
                    target.css({
                      marginLeft : -(target.outerWidth() / 2),
                      marginTop : -(target.outerHeight() / 2)
            Severity: Minor
            Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js - About 1 hr to fix

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

                        if (typeof data.is_scrolling === 'undefined') {
                          data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
                        }
              myblog/myapp/static/zinnia/js/foundation/foundation.orbit.js on lines 263..265

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

              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

                        var data = {
                              start_page_x: e.touches[0].pageX,
                              start_page_y: e.touches[0].pageY,
                              start_time: (new Date()).getTime(),
                              delta_x: 0,
              myblog/myapp/static/zinnia/js/foundation/foundation.orbit.js on lines 243..249

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

              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

                    if (target.next().length > 0) {
                      this.S('.clearing-main-next', visible_image).removeClass('disabled');
                    } else {
                      this.S('.clearing-main-next', visible_image).addClass('disabled');
                    }
              myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js on lines 347..351

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

              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

                    if (target.prev().length > 0) {
                      this.S('.clearing-main-prev', visible_image).removeClass('disabled');
                    } else {
                      this.S('.clearing-main-prev', visible_image).addClass('disabled');
                    }
              myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js on lines 341..345

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

              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 3 locations. Consider refactoring.
              Open

                  off : function () {
                    this.S(this.scope).off('.fndtn.clearing');
                    this.S(window).off('.fndtn.clearing');
                  },
              myblog/myapp/static/zinnia/js/foundation/foundation.magellan.js on lines 178..181
              myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js on lines 426..429

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

              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

                      if (/left/.test(direction)) {
                        this.lock();
                        dir_obj[dir] = left + width;
                        clearing.animate(dir_obj, 300, this.unlock());
                      } else if (/right/.test(direction)) {
              Severity: Minor
              Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js and 1 other location - About 40 mins to fix
              myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js on lines 478..482

              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

                      } else if (/right/.test(direction)) {
                        this.lock();
                        dir_obj[dir] = left - width;
                        clearing.animate(dir_obj, 300, this.unlock());
                      }
              Severity: Minor
              Found in myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js and 1 other location - About 40 mins to fix
              myblog/myapp/static/zinnia/js/foundation/foundation.clearing.js on lines 474..482

              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

              There are no issues that match your filters.

              Category
              Status