capistrano/capistrano

View on GitHub

Showing 58 of 115 total issues

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

        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

          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

            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 gets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def gets
                      return unless stdin.tty?
              
                      if echo?
                        stdin.gets
              Severity: Minor
              Found in lib/capistrano/configuration/question.rb - 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 el.show();
              Severity: Major
              Found in docs/assets/js/foundation/foundation.reveal.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return el.hide();
                Severity: Major
                Found in docs/assets/js/foundation/foundation.reveal.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return $(this.scope).width() < settings.small_breakpoint;
                  Severity: Major
                  Found in docs/assets/js/foundation/foundation.section.js - About 30 mins to fix

                    Method regex_matcher has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def regex_matcher(values)
                            values.map! do |v|
                              case v
                              when Regexp then v
                              else
                    Severity: Minor
                    Found in lib/capistrano/configuration/role_filter.rb - About 25 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 install has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def install(plugin, load_hooks: true, load_immediately: false)
                            plugin = plugin.is_a?(Class) ? plugin.new : plugin
                    
                            plugin.define_tasks
                            plugin.register_hooks if load_hooks
                    Severity: Minor
                    Found in lib/capistrano/configuration/plugin_installer.rb - About 25 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 print_deprecation_warnings_if_applicable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def print_deprecation_warnings_if_applicable
                            if using_default_scm?
                              warn_add_git_to_capfile unless scm_plugin_installed?
                            elsif built_in_scm_name?
                              warn_set_scm_is_deprecated
                    Severity: Minor
                    Found in lib/capistrano/configuration/scm_resolver.rb - About 25 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 regex_matcher has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def regex_matcher(values)
                            values.map! do |v|
                              case v
                              when Regexp then v
                              else
                    Severity: Minor
                    Found in lib/capistrano/configuration/host_filter.rb - About 25 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