capistrano/capistrano

View on GitHub

Showing 54 of 115 total issues

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

    refresh_custom_select: function ($select, force_refresh) {
      var self = this;
      var maxWidth = 0,
          $customSelect = $select.next(),
          $options = $select.find('option'),
Severity: Minor
Found in docs/assets/js/foundation/foundation.forms.js - About 1 hr to fix

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

        hide : function (el, css) {
          // is modal
          if (css) {
            if (/pop/i.test(this.settings.animation)) {
              var end_css = {
    Severity: Minor
    Found in docs/assets/js/foundation/foundation.reveal.js - About 1 hr to fix

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

          events : function () {
            var self = this;
      
            $(this.scope)
              .on('click.fndtn.clearing', 'ul[data-clearing] li',
      Severity: Minor
      Found in docs/assets/js/foundation/foundation.clearing.js - About 1 hr to fix

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

            var config = $.cookie = function (key, value, options) {
        
                // Write
        
                if (arguments.length > 1 && !$.isFunction(value)) {
        Severity: Minor
        Found in docs/assets/js/jquery.cookie.js - About 1 hr to fix

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

              init : function (section, method, options) {
                Foundation.inherit(this, 'data_options');
                var self = this;
          
                if (typeof method === 'object') {
          Severity: Minor
          Found in docs/assets/js/foundation/foundation.topbar.js - About 1 hr to fix

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

                events : function () {
                  var self = this;
            
                  $(this.scope)
                    .on('click.fndtn.section', '[data-section] .title, [data-section] [data-section-title]', function (e) {
            Severity: Minor
            Found in docs/assets/js/foundation/foundation.section.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.outerHeight(this.settings.$next_tip),
                        tip_offset = this.settings.$next_tip.offset(),
                        target_height = this.outerHeight(this.settings.$target),
                        $nub = $('.joyride-nub', this.settings.$next_tip),
              Severity: Minor
              Found in docs/assets/js/foundation/foundation.joyride.js - About 1 hr to fix

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

                  var config = $.cookie = function (key, value, options) {
                
                    // write
                    if (value !== undefined) {
                      options = $.extend({}, config.defaults, options);
                Severity: Minor
                Found in docs/assets/js/foundation/foundation.cookie.js - About 1 hr to fix

                  Method role_properties_for has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def role_properties_for(rolenames)
                          roles = rolenames.to_set
                          rps = Set.new unless block_given?
                          roles_for(rolenames).each do |host|
                            host.roles.intersection(roles).each do |role|
                  Severity: Minor
                  Found in lib/capistrano/configuration/servers.rb - About 1 hr 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 indexOf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
                        "use strict";
                        if (this == null) {
                          throw new TypeError();
                        }
                  Severity: Minor
                  Found in docs/assets/js/foundation/foundation.js - About 1 hr to fix

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

                        _init: function (idx, slider) {
                          var self = this,
                              $slides_container = $(slider),
                              $container = $slides_container.wrap(self._container_html()).parent(),
                              $slides = $slides_container.children();
                    Severity: Minor
                    Found in docs/assets/js/foundation/foundation.orbit.js - About 1 hr to fix

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

                          position_titles : function (section, off) {
                            var self = this,
                                titles = section
                                  .children(this.settings.region_selector)
                                  .map(function () {
                      Severity: Minor
                      Found in docs/assets/js/foundation/foundation.section.js - About 1 hr to fix

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

                              if (!this.rtl) {
                                target.css({
                                  marginLeft : -(this.outerWidth(target) / 2),
                                  marginTop : -(this.outerHeight(target) / 2)
                                });
                        Severity: Minor
                        Found in docs/assets/js/foundation/foundation.clearing.js and 1 other location - About 55 mins to fix
                        docs/assets/js/foundation/foundation.clearing.js on lines 308..313

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

                        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 {
                                target.css({
                                  marginRight : -(this.outerWidth(target) / 2),
                                  marginTop : -(this.outerHeight(target) / 2)
                                });
                        Severity: Minor
                        Found in docs/assets/js/foundation/foundation.clearing.js and 1 other location - About 55 mins to fix
                        docs/assets/js/foundation/foundation.clearing.js on lines 303..308

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

                        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

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

                              if (image[0].complete || image[0].readyState === 4) {
                                loaded();
                              } else {
                                bindLoad.call(image);
                              }
                        Severity: Minor
                        Found in docs/assets/js/foundation/foundation.interchange.js and 1 other location - About 50 mins to fix
                        docs/assets/js/foundation/foundation.clearing.js on lines 363..367

                        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

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

                              if (image[0].complete || image[0].readyState === 4) {
                                loaded();
                              } else {
                                bindLoad.call(image);
                              }
                        Severity: Minor
                        Found in docs/assets/js/foundation/foundation.clearing.js and 1 other location - About 50 mins to fix
                        docs/assets/js/foundation/foundation.interchange.js on lines 170..174

                        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

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

                            init : function (scope, libraries, method, options, response, /* internal */ nc) {
                        Severity: Minor
                        Found in docs/assets/js/foundation/foundation.js - About 45 mins to fix

                          Method setup_filters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def setup_filters
                                @filters = cmdline_filters
                                @filters += @custom_filters if @custom_filters
                                @filters << Filter.new(:role, ENV["ROLES"]) if ENV["ROLES"]
                                @filters << Filter.new(:host, ENV["HOSTS"]) if ENV["HOSTS"]
                          Severity: Minor
                          Found in lib/capistrano/configuration.rb - 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

                          Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def initialize(type, values=nil)
                                  raise "Invalid filter type #{type}" unless %i(host role).include? type
                                  av = Array(values)
                                  @strategy = if av.empty? then EmptyFilter.new
                                              elsif av.include?(:all) || av.include?("all") then NullFilter.new
                          Severity: Minor
                          Found in lib/capistrano/configuration/filter.rb - 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

                          Method select? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def select?(options)
                                  options.each do |k, v|
                                    callable = v.respond_to?(:call) ? v : ->(server) { server.fetch(v) }
                                    result = \
                                      case k
                          Severity: Minor
                          Found in lib/capistrano/configuration/server.rb - 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

                          Severity
                          Category
                          Status
                          Source
                          Language