capistrano/capistrano

View on GitHub

Showing 41 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

                        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

                          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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language