TimothyStiles/poly

View on GitHub
clone/clone.go

Summary

Maintainability
A
0 mins
Test Coverage

Function CutWithEnzyme has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
Wontfix

func CutWithEnzyme(seq Part, directional bool, enzyme Enzyme) []Fragment {
    var fragmentSeqs []string
    var sequence string
    if seq.Circular {
        sequence = strings.ToUpper(seq.Sequence + seq.Sequence)
Severity: Minor
Found in clone/clone.go - About 4 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

Function CutWithEnzyme has 79 lines of code (exceeds 50 allowed). Consider refactoring.
Wontfix

func CutWithEnzyme(seq Part, directional bool, enzyme Enzyme) []Fragment {
    var fragmentSeqs []string
    var sequence string
    if seq.Circular {
        sequence = strings.ToUpper(seq.Sequence + seq.Sequence)
Severity: Major
Found in clone/clone.go - About 2 hrs to fix

    Function recurseLigate has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
    Wontfix

    func recurseLigate(wg *sync.WaitGroup, constructs chan string, infiniteLoopingConstructs chan string, seedFragment Fragment, fragmentList []Fragment, usedFragments []Fragment) {
        // Recurse ligate simulates all possible ligations of a series of fragments. Each possible combination begins with a "seed" that fragments from the pool can be added to.
        defer wg.Done()
        // If the seed ligates to itself, we can call it done with a successful circularization!
        if seedFragment.ForwardOverhang == seedFragment.ReverseOverhang {
    Severity: Minor
    Found in clone/clone.go - 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

    Function recurseLigate has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

    func recurseLigate(wg *sync.WaitGroup, constructs chan string, infiniteLoopingConstructs chan string, seedFragment Fragment, fragmentList []Fragment, usedFragments []Fragment) {
    Severity: Minor
    Found in clone/clone.go - About 45 mins to fix

      Your code does not pass gofmt in 2 places. Go fmt your code!
      Open

      /*
      Severity: Minor
      Found in clone/clone.go by gofmt

      There are no issues that match your filters.

      Category
      Status