shyamrallapalli/cheripic

View on GitHub
lib/cheripic/cmd.rb

Summary

Maintainability
C
1 day
Test Coverage

Method argument_parser has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def argument_parser
      cmds = self
      Trollop::Parser.new do
        version Cheripic::VERSION
        banner cmds.help_message
Severity: Major
Found in lib/cheripic/cmd.rb - About 4 hrs to fix

    Method check_input_files has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_input_files(inputfiles)
          inputfiles.each_key do | type |
            inputfiles[type].flatten!
            check = 0
            inputfiles[type].each do | symbol |
    Severity: Minor
    Found in lib/cheripic/cmd.rb - About 3 hrs 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

    File cmd.rb has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Cheripic
    
      # A command line option and processing object to handle input options
      #
      # @!attribute [rw] options
    Severity: Minor
    Found in lib/cheripic/cmd.rb - About 2 hrs to fix

      Method check_input_files has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def check_input_files(inputfiles)
            inputfiles.each_key do | type |
              inputfiles[type].flatten!
              check = 0
              inputfiles[type].each do | symbol |
      Severity: Minor
      Found in lib/cheripic/cmd.rb - About 1 hr to fix

        Method convert_boolean_strings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def convert_boolean_strings
              %i{ambiguous_ref_bases use_all_contigs include_low_hmes polyploidy}.each do | symbol |
                if @options.key?(symbol)
                  @options[symbol] = @options[symbol] == 'false' ? false : true
                end
        Severity: Minor
        Found in lib/cheripic/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

        There are no issues that match your filters.

        Category
        Status