ZuluPro/myblog

View on GitHub

Showing 64 of 163 total issues

Function resize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    resize : function () {
      var self = this;
      self.S('[' + this.attr_name() + ']').each(function () {
        var topbar = self.S(this),
            settings = topbar.data(self.attr_name(true) + '-init');
Severity: Minor
Found in myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js - About 1 hr to fix

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

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

      Function init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init : function (section, method, options) {
            Foundation.inherit(this, 'add_custom_rule register_media throttle');
            var self = this;
      
            self.register_media('topbar', 'foundation-mq-topbar');
      Severity: Minor
      Found in myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js - About 1 hr to fix

        Function build_markup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            self.build_markup = function() {
              slides_container.wrap('<div class="'+settings.container_class+'"></div>');
              container = slides_container.parent();
              slides_container.addClass(settings.slides_container_class);
        
        
        Severity: Minor
        Found in myblog/myapp/static/zinnia/js/foundation/foundation.orbit.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 pos_phone has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                pos_phone : function (init) {
                  var tip_height = this.settings.$next_tip.outerHeight(),
                      tip_offset = this.settings.$next_tip.offset(),
                      target_height = this.settings.$target.outerHeight(),
                      $nub = $('.joyride-nub', this.settings.$next_tip),
            Severity: Minor
            Found in myblog/myapp/static/zinnia/js/foundation/foundation.joyride.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

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

                    equalize: function(equalizer) {
                      var isStacked = false,
                          vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'),
                          settings = equalizer.data(this.attr_name(true)+'-init');
                
                
                Severity: Minor
                Found in myblog/myapp/static/zinnia/js/foundation/foundation.equalizer.js - About 1 hr to fix

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

                      set_ui : function($handle, value) {
                        var settings = $.data($handle[0], 'settings'),
                            handle_l = $.data($handle[0], 'handle_l'),
                            bar_l = $.data($handle[0], 'bar_l'),
                            norm_pct = this.normalized_percentage(value, settings.start, settings.end),
                  Severity: Minor
                  Found in myblog/myapp/static/zinnia/js/foundation/foundation.slider.js - About 1 hr to fix

                    Function assemble has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        assemble : function (topbar) {
                          var self = this,
                              settings = topbar.data(this.attr_name(true) + '-init'),
                              section = self.S('section', topbar);
                    
                    
                    Severity: Minor
                    Found in myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js - About 1 hr to fix

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

                          events : function (scope) {
                            var self = this,
                                form = self.S(scope).attr('novalidate', 'novalidate'),
                                settings = form.data(this.attr_name(true) + '-init') || {};
                      
                      
                      Severity: Minor
                      Found in myblog/myapp/static/zinnia/js/foundation/foundation.abide.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if ($.data(self.cache.active[0], 'settings').vertical) {
                                      var scroll_offset = 0;
                                      if (!e.pageY) {
                                        scroll_offset = window.scrollY;
                                      }
                        Severity: Major
                        Found in myblog/myapp/static/zinnia/js/foundation/foundation.slider.js - About 1 hr to fix

                          Function get_formatters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def get_formatters():
                              fs = []
                              for f in s.INSTALLED_APPS:
                                  try:
                                      f_module = __import__(f, fromlist=['setting_formatters']).setting_formatters
                          Severity: Minor
                          Found in myblog/myapp/management/commands/settings.py - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function app has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              .controller("SkillListCtrl", ['$scope', '$window', function($scope, $window) {
                                  var skillList = this;
                          
                                  skillList.filter = function () {
                                    var skillList = this;
                          Severity: Minor
                          Found in myblog/about/static/js/about.js - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Avoid deeply nested control flow statements.
                          Open

                                      if (self.S(klass).hasClass('fixed')) {
                                        self.S(klass).removeClass('fixed');
                                        self.S('body').removeClass('f-topbar-fixed');
                                      }
                          Severity: Major
                          Found in myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (this.settings.timer > 0) {
                            
                                          this.settings.$next_tip
                                            .fadeIn(this.settings.tip_animation_fade_speed)
                                            .show();
                            Severity: Major
                            Found in myblog/myapp/static/zinnia/js/foundation/foundation.joyride.js - About 45 mins to fix

                              Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  init : function (scope, libraries, method, options, response) {
                              Severity: Minor
                              Found in myblog/myapp/static/zinnia/js/foundation/foundation.js - About 35 mins to fix

                                Function get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def get(self, request):
                                        context = self.get_context()
                                        context['format'] = request.GET.get('format')
                                        if request.GET.get('q'):
                                            validator = self.validators.get(request.GET.get('format'))
                                Severity: Minor
                                Found in myblog/mytools/views.py - About 35 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Avoid too many return statements within this function.
                                Open

                                      return false;
                                Severity: Major
                                Found in myblog/myapp/static/zinnia/js/foundation/foundation.tooltip.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return false;
                                  Severity: Major
                                  Found in myblog/myapp/static/zinnia/js/foundation/foundation.topbar.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language