wurmlab/GeneValidator

View on GitHub
lib/genevalidator.rb

Summary

Maintainability
A
1 hr
Test Coverage
D
66%

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

    def run
      # Run BLAST on all sequences (generates @opt[:blast_xml_file])
      # if no BLAST OUTPUT file provided...
      unless @opt[:blast_xml_file] || @opt[:blast_tabular_file]
        blast_xml_fname = "#{dirs[:filename]}.blast_xml"
Severity: Minor
Found in lib/genevalidator.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_raw_seq_files has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def copy_raw_seq_files(prev_tmp_dir)
      return if @opt[:raw_sequences]
      return unless @opt[:validations].include?('align') ||
                    @opt[:validations].include?('dup')
      prev_raw_seq = Dir[File.join(prev_tmp_dir, '*raw_seq')]
Severity: Minor
Found in lib/genevalidator.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

There are no issues that match your filters.

Category
Status