tmuxinator/tmuxinator

View on GitHub

Showing 13 of 18 total issues

Class Project has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Project
    include Tmuxinator::Util
    include Tmuxinator::Deprecations
    include Tmuxinator::Hooks::Project

Severity: Major
Found in lib/tmuxinator/project.rb - About 7 hrs to fix

    File cli.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "open3"
    
    module Tmuxinator
      class Cli < Thor
        # By default, Thor returns exit(0) when an error occurs.
    Severity: Minor
    Found in lib/tmuxinator/cli.rb - About 4 hrs to fix

      Class Config has 29 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Config
          LOCAL_DEFAULT = "./.tmuxinator.yml".freeze
          NO_LOCAL_FILE_MSG =
            "Project file at ./.tmuxinator.yml doesn't exist.".freeze
          NO_PROJECT_FOUND_MSG = "Project could not be found.".freeze
      Severity: Minor
      Found in lib/tmuxinator/config.rb - About 3 hrs to fix

        File project.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Tmuxinator
          class Project
            include Tmuxinator::Util
            include Tmuxinator::Deprecations
            include Tmuxinator::Hooks::Project
        Severity: Minor
        Found in lib/tmuxinator/project.rb - About 3 hrs to fix

          Class Cli has 26 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Cli < Thor
              # By default, Thor returns exit(0) when an error occurs.
              # Please see: https://github.com/tmuxinator/tmuxinator/issues/192
              def self.exit_on_failure?
                true
          Severity: Minor
          Found in lib/tmuxinator/cli.rb - About 3 hrs to fix

            Class Window has 25 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class Window
                include Tmuxinator::Util
            
                attr_reader :commands, :index, :name, :project
            
            
            Severity: Minor
            Found in lib/tmuxinator/window.rb - About 2 hrs to fix

              Method new_project_with_session has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def new_project_with_session(name, session)
                      if Tmuxinator::Config.version < 1.6
                        raise "Creating projects from sessions is unsupported\
                          for tmux version 1.5 or lower."
                      end
              Severity: Minor
              Found in lib/tmuxinator/cli.rb - About 1 hr to fix

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

                      def new_project_with_session(name, session)
                        if Tmuxinator::Config.version < 1.6
                          raise "Creating projects from sessions is unsupported\
                            for tmux version 1.5 or lower."
                        end
                Severity: Minor
                Found in lib/tmuxinator/cli.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 build_commands has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def build_commands(_prefix, command_yml)
                      if command_yml.is_a?(Array)
                        command_yml.map do |command|
                          "#{tmux_window_command_prefix} #{command.shellescape} C-m" if command
                        end.compact
                Severity: Minor
                Found in lib/tmuxinator/window.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 create_project has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                      def create_project(project_options = {})
                        # Strings provided to --attach are coerced into booleans by Thor.
                        # "f" and "false" will result in `:attach` being `false` and any other
                        # string or the empty flag will result in `:attach` being `true`.
                        # If the flag is not present, `:attach` will be `nil`.
                Severity: Minor
                Found in lib/tmuxinator/cli.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                      def validate(options = {})
                        name = options[:name]
                        options[:force_attach] ||= false
                        options[:force_detach] ||= false
                        project_config = options.fetch(:project_config) { false }
                Severity: Minor
                Found in lib/tmuxinator/config.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 delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def delete(*projects)
                      projects.each do |project|
                        if Tmuxinator::Config.exists?(name: project)
                          config = Tmuxinator::Config.project(project)
                
                
                Severity: Minor
                Found in lib/tmuxinator/cli.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 copy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def copy(existing, new)
                      existing_config_path = Tmuxinator::Config.project(existing)
                      new_config_path = Tmuxinator::Config.project(new)
                
                      exit!("Project #{existing} doesn't exist!") \
                Severity: Minor
                Found in lib/tmuxinator/cli.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