ShogunPanda/bovem

View on GitHub

Showing 39 of 48 total issues

File console.rb has 349 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Bovem
  # List of valid terminal colors.
  TERM_COLORS = {black: 0, red: 1, green: 2, yellow: 3, blue: 4, magenta: 5, cyan: 6, white: 7, default: 9}.freeze

  # List of valid terminal text effects.
Severity: Minor
Found in lib/bovem/console.rb - About 4 hrs to fix

    File shell.rb has 325 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Bovem
      # Methods of the {Shell Shell} class.
      module ShellMethods
        # General methods.
        module General
    Severity: Minor
    Found in lib/bovem/shell.rb - About 3 hrs to fix

      File command.rb has 265 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Bovem
        # Methods for the {Command Command} class.
        module CommandMethods
          # Methods for showing help messages.
          module Help
      Severity: Minor
      Found in lib/bovem/command.rb - About 2 hrs to fix

        Class Option has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Option
            attr_accessor :name
            attr_accessor :short
            attr_accessor :long
            attr_accessor :type
        Severity: Minor
        Found in lib/bovem/option.rb - About 2 hrs to fix

          Function generateTOC has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function generateTOC() {
            if ($('#filecontents').length === 0) return;
            var _toc = $('<ol class="top"></ol>');
            var show = false;
            var toc = _toc;
          Severity: Minor
          Found in docs/js/app.js - About 2 hrs to fix

            Method handle_copy_or_move_failure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def handle_copy_or_move_failure(single, src, show_errors, fatal, single_msg, multi_msg, error)
                    if fatal || show_errors
                      if single
                        @console.send(fatal ? :fatal : :error, single_msg, suffix: "\n", indented: 5)
                      else
            Severity: Minor
            Found in lib/bovem/shell.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

            Method match_pattern has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def match_pattern(entry, patterns, by_extension)
                    catch(:found) do
                      if block_given?
                        throw(:found, true) if yield(entry)
                      else
            Severity: Minor
            Found in lib/bovem/shell.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

            Method prepare_destination has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                  def prepare_destination(single, src, dst, operation, show_errors, fatal)
                    dst_dir = single ? File.dirname(dst) : dst
                    has_dir = check(dst_dir, :dir)
            
                    # Create directory
            Severity: Minor
            Found in lib/bovem/shell.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

            Method find has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                  def find(directories, patterns: [], extension_only: false, case_sensitive: false, &block)
                    rv = []
            
                    directories = directories.ensure_array(no_duplicates: true, compact: true, flatten: true) { |d| File.expand_path(d.ensure_string) }
                    patterns = normalize_patterns(patterns, extension_only, case_sensitive)
            Severity: Minor
            Found in lib/bovem/shell.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

            Method parse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse(file = nil, overrides = {}, logger = nil)
                  file = file.present? ? File.expand_path(file) : nil
            
                  if file
                    raise(Bovem::Errors::InvalidConfiguration, i18n.not_found(file)) unless File.readable?(file)
            Severity: Minor
            Found in lib/bovem/configuration.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 summaryToggle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function summaryToggle() {
              $('.summary_toggle').click(function(e) {
                e.preventDefault();
                localStorage.summaryCollapsed = $(this).text();
                $('.summary_toggle').each(function() {
            Severity: Minor
            Found in docs/js/app.js - About 1 hr to fix

              Method handle_copy_or_move_general_erorr has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def handle_copy_or_move_general_erorr(src, dst, dst_dir, single, e, operation_s, show_errors, fatal)
              Severity: Major
              Found in lib/bovem/shell.rb - About 1 hr to fix

                Method execute_copy_or_move has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def execute_copy_or_move(src, dst, dst_dir, single, operation, operation_s, show_errors, fatal)
                Severity: Major
                Found in lib/bovem/shell.rb - About 1 hr to fix

                  Method try_create_directory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def try_create_directory(directory, mode, fatal, directories, show_errors)
                          rv = false
                  
                          # Perform tests
                          if check(directory, :directory)
                  Severity: Minor
                  Found in lib/bovem/shell.rb - About 55 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 handle_failure has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        def handle_failure(e, access_error, not_found_error, general_error, entries, fatal, show_errors)
                  Severity: Major
                  Found in lib/bovem/shell.rb - About 50 mins to fix

                    Method handle_copy_or_move_access_error has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def handle_copy_or_move_access_error(src, dst, dst_dir, single, operation_s, show_errors, fatal)
                    Severity: Major
                    Found in lib/bovem/shell.rb - About 50 mins to fix

                      Method handle_copy_or_move_failure has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            def handle_copy_or_move_failure(single, src, show_errors, fatal, single_msg, multi_msg, error)
                      Severity: Major
                      Found in lib/bovem/shell.rb - About 50 mins to fix

                        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

                            Severity
                            Category
                            Status
                            Source
                            Language