leoniv/ass_launcher

View on GitHub

Showing 44 of 44 total issues

Method path_exist has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def path_exist(name, desc, *clients, **options, &block)
Severity: Minor
Found in lib/ass_launcher/enterprise/cli/spec_dsl.rb - About 35 mins to fix

    Method switch has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def switch(name, desc, *clients, **options, &block)
    Severity: Minor
    Found in lib/ass_launcher/enterprise/cli/spec_dsl.rb - About 35 mins to fix

      Method num has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def num(name, desc, *clients, **options, &block)
      Severity: Minor
      Found in lib/ass_launcher/enterprise/cli/spec_dsl.rb - About 35 mins to fix

        Method path_twice has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def path_twice(name, desc, *clients, **options, &block)
        Severity: Minor
        Found in lib/ass_launcher/enterprise/cli/spec_dsl.rb - About 35 mins to fix

          Method path has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def path(name, desc, *clients, **options, &block)
          Severity: Minor
          Found in lib/ass_launcher/enterprise/cli/spec_dsl.rb - About 35 mins to fix

            Method dry_run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def dry_run(cmd)
                      r = "#{cmd.cmd.gsub(' ', '\\ ')} "
                      if mode == :createinfobase
                        r << cmd.args.join(' ')
                      else
            Severity: Minor
            Found in lib/ass_launcher/cmd.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 args has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                        def args
                          r = {}
                          r[:name] = name
                          r[:subparameters] = subparameters if subparameters
                          r[:group] = group if group
            Severity: Minor
            Found in bin/lib/dev_helper/cli_def_snippets.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 to_cmd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def to_cmd
                    r = ''
                    args = to_args
                    args.each_with_index do |v, i|
                      next unless i.even?
            Severity: Minor
            Found in lib/ass_launcher/support/connection_string.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

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

                    module Dbsrv
                      attr_reader :dbsrv_user, :dbsrv_pass, :dbsrv_host
                      include Support::SrvStrParser
                      def parse_dbsrv(s)
                        @dbsrv_host, @dbsrv_user, @dbsrv_pass = parse_srv_str(s)
            Severity: Minor
            Found in lib/ass_launcher/cmd.rb and 1 other location - About 30 mins to fix
            lib/ass_launcher/cmd.rb on lines 321..332

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

            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

                    module Esrv
                      attr_reader :esrv_user, :esrv_pass, :esrv_host
                      include Support::SrvStrParser
                      def parse_esrv(s)
                        @esrv_host, @esrv_user, @esrv_pass = parse_srv_str(s)
            Severity: Minor
            Found in lib/ass_launcher/cmd.rb and 1 other location - About 30 mins to fix
            lib/ass_launcher/cmd.rb on lines 304..314

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

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

                    def dsl_method_args(i)
                      r = "'#{name}'"
                      r << ", '#{desc}'" if desc
                      r << ", #{clients.map(&:to_s).map(&:downcase)
                        .to_s.gsub(/(\[|\]|")/,'')}" if clients
            Severity: Minor
            Found in bin/lib/dev_helper/cli_def_snippets.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 to_args_private_proxy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    def to_args_private_proxy(r)
                      return r unless !wspauto && wspsrv
                      r += ['/Proxy', '', '-Psrv', wspsrv]
                      r += ['-PPort', wspport.to_s] if wspport
                      r += ['-PUser', wspuser] if wspuser
            Severity: Minor
            Found in lib/ass_launcher/support/connection_string.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 uri_query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    def uri_query
                      r = ''
                      r << "N=#{usr}&" if usr
                      r << "P=#{pwd}&" if pwd
                      r << "L=#{locale}&" if locale
            Severity: Minor
            Found in lib/ass_launcher/support/connection_string.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 make_command has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    def make_command
                      usr = user
                      pass = password
                      uc_ = uc
                      cs = connection_string
            Severity: Minor
            Found in lib/ass_launcher/cmd.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 to_query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def to_query(args)
                    r = ''
                    args.each_with_index do |v, i|
                      next if (i + 1).even?
                      r << "#{v.gsub(CLI_TO_WEB_PARAM_NAME, '')}"
            Severity: Minor
            Found in lib/ass_launcher/enterprise/web_client.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 included has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def self.included(base)
                    base.fields.each do |f|
                      base.send(:attr_reader, f.downcase.to_sym) unless\
                        base.instance_methods.include? f.downcase.to_sym
                      base.send(:attr_writer, f.downcase.to_sym) unless\
            Severity: Minor
            Found in lib/ass_launcher/support/connection_string.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 select_parameters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                      def select_parameters
                        r = []
                        AssLauncher::Enterprise::Cli::CliSpec
                          .cli_def.parameters.parameters.each do |p|
                          if match?(p) && not_filtred?(p)
            Severity: Minor
            Found in lib/ass_launcher/cmd.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

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

                      class Chose < New::Abstract
                        option ['-l', '--chose-list'], 'VALUES ...', 'list of accepted values',
                          required: true do |s|
                          s.split.map(&:to_sym)
                        end
            Severity: Minor
            Found in bin/lib/dev_helper/cli_def_snippets.rb and 1 other location - About 20 mins to fix
            bin/lib/dev_helper/cli_def_snippets.rb on lines 116..125

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

            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

                      class Switch < New::Abstract
                        option ['-l', '--switch-list'], 'VALUES ...', 'list of accepted values',
                          required: true do |s|
                          s.split.map(&:to_sym)
                        end
            Severity: Minor
            Found in bin/lib/dev_helper/cli_def_snippets.rb and 1 other location - About 20 mins to fix
            bin/lib/dev_helper/cli_def_snippets.rb on lines 129..138

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

            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

                  it 'File connection string: Api.cs_file method' do
                    extend AssLauncher::Api
                    conns = cs_file file: 'path', usr: 'user name', pwd: 'pass'
            
                    conns.must_be_instance_of AssLauncher::Support::ConnectionString::File
            Severity: Minor
            Found in examples/connection_string_example.rb and 1 other location - About 20 mins to fix
            examples/connection_string_example.rb on lines 50..55

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

            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