clone/clone.go
Function CutWithEnzyme
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Wontfix
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)
- Read upRead up
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
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)
Function recurseLigate
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Wontfix
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 {
- Read upRead up
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
Wontfix
func recurseLigate(wg *sync.WaitGroup, constructs chan string, infiniteLoopingConstructs chan string, seedFragment Fragment, fragmentList []Fragment, usedFragments []Fragment) {
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
/*
- Exclude checks