pierreozoux/virtualman

View on GitHub

Showing 4 of 4 total issues

Method check_plist_file has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def check_plist_file
        puts "Checking plist file..."
        plist_file = "org.virtualbox.vboxautostart.plist"
        plist_path = "/Library/LaunchDaemons/"

Severity: Minor
Found in lib/virtualman/interactive/helper.rb - About 1 hr to fix

    Method integrate_template has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def integrate_template filename, path, template_string, *variables
            template = ERB.new(template_string, 0, "%<>")
    
            templated = template.result(binding)
    
    
    Severity: Minor
    Found in lib/virtualman/interactive/helper.rb - About 1 hr to fix

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

            def integrate_template filename, path, template_string, *variables
              template = ERB.new(template_string, 0, "%<>")
      
              templated = template.result(binding)
      
      
      Severity: Minor
      Found in lib/virtualman/interactive/helper.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 start_vm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def start_vm(vm)
              if !vm.running?
                puts "Do you want to start the VM? headless?"
                puts "(default is no)"
                puts "yes/headless/[no]"
      Severity: Minor
      Found in lib/virtualman/interactive/helper.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

      Severity
      Category
      Status
      Source
      Language