capistrano/capistrano

View on GitHub

Showing 115 of 115 total issues

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 _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 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

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

                $('form.custom input[type="checkbox"]', $(this.scope))
                  .not('[data-customforms="disabled"]')
                  .not('.' + this.settings.disable_class)
                  .each(this.append_custom_markup);
          Severity: Major
          Found in docs/assets/js/foundation/foundation.forms.js and 1 other location - About 1 hr to fix
          docs/assets/js/foundation/foundation.forms.js on lines 36..39

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

          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

                $('form.custom input[type="radio"]', $(this.scope))
                  .not('[data-customforms="disabled"]')
                  .not('.' + this.settings.disable_class)
                  .each(this.append_custom_markup);
          Severity: Major
          Found in docs/assets/js/foundation/foundation.forms.js and 1 other location - About 1 hr to fix
          docs/assets/js/foundation/foundation.forms.js on lines 40..43

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

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

            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

            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

            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

              Avoid deeply nested control flow statements.
              Open

                          if (this.settings.timer > 0) {
              
                            this.settings.$next_tip
                              .fadeIn(this.settings.tipAnimationFadeSpeed)
                              .show();
              Severity: Major
              Found in docs/assets/js/foundation/foundation.joyride.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if ($customRadio.length === 0) {
                                  $customRadio = $associatedElement.add(this).siblings('span.custom.radio').first();
                                }
                Severity: Major
                Found in docs/assets/js/foundation/foundation.forms.js - About 45 mins to fix

                  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

                  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

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

                                top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height),
                  Severity: Minor
                  Found in docs/assets/js/foundation/foundation.joyride.js and 1 other location - About 40 mins to fix
                  docs/assets/js/foundation/foundation.joyride.js on lines 466..466

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

                  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 (/fade/i.test(this.settings.animation)) {
                          return el.fadeIn(this.settings.animationSpeed / 2);
                        }
                  Severity: Minor
                  Found in docs/assets/js/foundation/foundation.reveal.js and 1 other location - About 40 mins to fix
                  docs/assets/js/foundation/foundation.reveal.js on lines 281..283

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language