TimothyStiles/poly

View on GitHub
synthesis/fix/synthesis.go

Summary

Maintainability
A
0 mins
Test Coverage

Function Cds has a Cognitive Complexity of 73 (exceeds 20 allowed). Consider refactoring.
Wontfix

func Cds(sequence string, codontable codon.Table, problematicSequenceFuncs []func(string, chan DnaSuggestion, *sync.WaitGroup)) (string, []Change, error) {

    codonLength := 3
    if len(sequence)%codonLength != 0 {
        return "", []Change{}, errors.New("this sequence isn't a complete CDS, please try to use a CDS without interrupted codons")
Severity: Minor
Found in synthesis/fix/synthesis.go - About 1 day 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 Cds has 122 lines of code (exceeds 50 allowed). Consider refactoring.
Wontfix

func Cds(sequence string, codontable codon.Table, problematicSequenceFuncs []func(string, chan DnaSuggestion, *sync.WaitGroup)) (string, []Change, error) {

    codonLength := 3
    if len(sequence)%codonLength != 0 {
        return "", []Change{}, errors.New("this sequence isn't a complete CDS, please try to use a CDS without interrupted codons")
Severity: Major
Found in synthesis/fix/synthesis.go - About 3 hrs to fix

    Function Cds has 9 return statements (exceeds 4 allowed).
    Wontfix

    func Cds(sequence string, codontable codon.Table, problematicSequenceFuncs []func(string, chan DnaSuggestion, *sync.WaitGroup)) (string, []Change, error) {
    
        codonLength := 3
        if len(sequence)%codonLength != 0 {
            return "", []Change{}, errors.New("this sequence isn't a complete CDS, please try to use a CDS without interrupted codons")
    Severity: Major
    Found in synthesis/fix/synthesis.go - About 55 mins to fix

      There are no issues that match your filters.

      Category
      Status