ShogunPanda/bovem

View on GitHub

Showing 48 of 48 total issues

Method parse_number has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def parse_number(command, opts, option, check_method, convert_method, invalid_message)
Severity: Minor
Found in lib/bovem/parser.rb - About 45 mins to fix

    Method prepare_destination has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def prepare_destination(single, src, dst, operation, show_errors, fatal)
    Severity: Minor
    Found in lib/bovem/shell.rb - About 45 mins to fix

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

            def create_directories(*directories, mode: 0755, run: true, show_errors: false, fatal_errors: true)
              rv = true
      
              # Adjust directory
              directories = directories.ensure_array(no_duplicates: true, compact: true, flatten: true) { |d| File.expand_path(d.ensure_string) }
      Severity: Minor
      Found in lib/bovem/shell.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 replace_markers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def replace_markers(message, plain = false)
                stack = []
      
                message.ensure_string.gsub(/((\{mark=([a-z\-_\s,]+)\})|(\{\/mark\}))/mi) do
                  if $LAST_MATCH_INFO[1] == "{/mark}" # If it is a tag, pop from the latest opened.
      Severity: Minor
      Found in lib/bovem/console.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 copy_or_move has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def copy_or_move(src, dst, operation, run = true, show_errors = true, fatal = true)
      Severity: Minor
      Found in lib/bovem/shell.rb - About 45 mins to fix

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

              def validate_input_value(reply, validator)
                # Match against the validator
                if validator.present?
                  if validator.is_a?(Array)
                    reply = validate_array(reply, validator)
        Severity: Minor
        Found in lib/bovem/console.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 progress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def progress(current, total, type: :list, precision: 0)
                if type == :list
                  compute_list_progress(current, total)
                else
                  precision = [0, precision].max
        Severity: Minor
        Found in lib/bovem/console.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

          }, function() {
            $('#toc .top').slideDown('fast');
            $('#toc').toggleClass('hidden');
            $('#toc .title small').toggle();
          });
        Severity: Minor
        Found in docs/js/app.js and 1 other location - About 45 mins to fix
        docs/js/app.js on lines 165..169

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

        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 3 locations. Consider refactoring.
        Open

              def warn(message, suffix: "\n", indented: true, wrap: false, plain: false, indented_banner: false, full_colored: false, print: true)
                info(
                  message,
                  suffix: suffix,
                  indented: indented,
        Severity: Minor
        Found in lib/bovem/console.rb and 2 other locations - About 40 mins to fix
        lib/bovem/console.rb on lines 465..476
        lib/bovem/console.rb on lines 519..530

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

        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 3 locations. Consider refactoring.
        Open

              def debug(message, suffix: "\n", indented: true, wrap: false, plain: false, indented_banner: false, full_colored: false, print: true)
                info(
                  message,
                  suffix: suffix,
                  indented: indented,
        Severity: Minor
        Found in lib/bovem/console.rb and 2 other locations - About 40 mins to fix
        lib/bovem/console.rb on lines 492..503
        lib/bovem/console.rb on lines 519..530

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

        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 3 locations. Consider refactoring.
        Open

              def error(message, suffix: "\n", indented: true, wrap: false, plain: false, indented_banner: false, full_colored: false, print: true)
                info(
                  message,
                  suffix: suffix,
                  indented: indented,
        Severity: Minor
        Found in lib/bovem/console.rb and 2 other locations - About 40 mins to fix
        lib/bovem/console.rb on lines 465..476
        lib/bovem/console.rb on lines 492..503

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

        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 create_directory has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def create_directory(directory, mode, fatal, directories, show_errors)
        Severity: Minor
        Found in lib/bovem/shell.rb - About 35 mins to fix

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

                def try_create_directory(directory, mode, fatal, directories, show_errors)
          Severity: Minor
          Found in lib/bovem/shell.rb - About 35 mins to fix

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

                    $(this).parent().prev().height($(this).parent().height());
            Severity: Minor
            Found in docs/js/app.js and 1 other location - About 35 mins to fix
            docs/js/app.js on lines 42..42

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

            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

                    $(this).parent().prev().height($(this).parent().height());
            Severity: Minor
            Found in docs/js/app.js and 1 other location - About 35 mins to fix
            docs/js/app.js on lines 26..26

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

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

                  def check(path, *tests)
                    path = path.ensure_string
            
                    tests.ensure_array(no_duplicates: true, compact: true, flatten: true).all? do |test|
                      # Adjust test name
            Severity: Minor
            Found in lib/bovem/shell.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 indent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def indent(message, width = true, newline_separator = "\n")
                    if width.to_integer != 0
                      width = (width.is_a?(TrueClass) ? 0 : width.to_integer)
                      width = width < 0 ? -width : @indentation + width
            
            
            Severity: Minor
            Found in lib/bovem/console.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 show_help has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def show_help
                    console = application? ? self.console : application.console
                    application? ? show_help_application_summary(console) : show_help_command_summary(console)
                    show_help_banner(console) if banner?
                    show_help_options(console) if options?
            Severity: Minor
            Found in lib/bovem/command.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 check_sources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def check_sources(src, operation, fatal)
                    # Check that every file is existing
                    src.ensure_array.each do |s|
                      unless check(s, :exists)
                        @console.send(fatal ? :fatal : :error, i18n.copy_move_src_not_found(operation, s))
            Severity: Minor
            Found in lib/bovem/shell.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 read_input_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                  def read_input_value(prompt, echo, default_value = nil)
                    if prompt
                      Kernel.print(format(prompt, suffix: false, indented: false))
                      $stdout.flush
                    end
            Severity: Minor
            Found in lib/bovem/console.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