Showing 34 of 45 total issues
Function getRSIU
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Open
func getRSIU(stop *Value, vs ValueSeries, rsiu ValueSeries, l int64) ValueSeries {
firstVal := rsiu.GetLast()
if firstVal == nil {
firstVal = vs.GetFirst()
- 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 getRSID
has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring. Open
func getRSID(stop *Value, vs ValueSeries, rsid ValueSeries, l int64) ValueSeries {
firstVal := rsid.GetLast()
if firstVal == nil {
firstVal = vs.GetFirst()
- 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 getSum
has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring. Open
func getSum(stop Value, sum ValueSeries, src ValueSeries, l int) ValueSeries {
// keep track of the source values of sum, maximum of l+1 items
sumSrc := make([]float64, 0)
var startNew *Value
- 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 SMA
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
func SMA(p ValueSeries, l int64) ValueSeries {
key := fmt.Sprintf("sma:%s:%d", p.ID(), l)
sma := getCache(key)
if sma == nil {
sma = NewValueSeries()
- 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 getRSI
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getRSI(stop *Value, vs ValueSeries, rsi ValueSeries, l int64) ValueSeries {
rsiukey := fmt.Sprintf("rsiu:%s:%d", vs.ID(), l)
rsiu := getCache(rsiukey)
if rsiu == nil {
Function SMA
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func SMA(p ValueSeries, l int64) ValueSeries {
key := fmt.Sprintf("sma:%s:%d", p.ID(), l)
sma := getCache(key)
if sma == nil {
sma = NewValueSeries()
Function getSum
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getSum(stop Value, sum ValueSeries, src ValueSeries, l int) ValueSeries {
// keep track of the source values of sum, maximum of l+1 items
sumSrc := make([]float64, 0)
var startNew *Value
Function valueWhen
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func valueWhen(stop Value, bs, src, vw ValueSeries, ocr int) ValueSeries {
var val *Value
lastvw := vw.GetCurrent()
- 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 getRSIU
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getRSIU(stop *Value, vs ValueSeries, rsiu ValueSeries, l int64) ValueSeries {
firstVal := rsiu.GetLast()
if firstVal == nil {
firstVal = vs.GetFirst()
Function getRSID
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getRSID(stop *Value, vs ValueSeries, rsid ValueSeries, l int64) ValueSeries {
firstVal := rsid.GetLast()
if firstVal == nil {
firstVal = vs.GetFirst()
Function getOHLCVAttr
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getOHLCVAttr(stop OHLCV, src OHLCVSeries, dest ValueSeries, p OHLCProp) ValueSeries {
var startt time.Time
firstVal := dest.GetLast()
Function DMI
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func DMI(ohlcv OHLCVSeries, len, smoo int) (adx, plus, minus ValueSeries) {
adxkey := fmt.Sprintf("adx:%s:%d:%d", ohlcv.ID(), len, smoo)
adx = getCache(adxkey)
if adx == nil {
adx = NewValueSeries()
Function roc
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func roc(stop Value, src, roc, chg ValueSeries, l int) ValueSeries {
var val *Value
lastvw := roc.GetCurrent()
- 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 roc
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
func roc(stop Value, src, roc, chg ValueSeries, l int) ValueSeries {
var val *Value
lastvw := roc.GetCurrent()
Function valueWhen
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
func valueWhen(stop Value, bs, src, vw ValueSeries, ocr int) ValueSeries {
var val *Value
lastvw := vw.GetCurrent()
Function MFI
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
func MFI(o OHLCVSeries, l int64) ValueSeries {
key := fmt.Sprintf("mfi:%s:%d", o.ID(), l)
mfi := getCache(key)
if mfi == nil {
mfi = NewValueSeries()
Function getRSI
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
func getRSI(stop *Value, vs ValueSeries, rsi ValueSeries, l int64) ValueSeries {
rsiukey := fmt.Sprintf("rsiu:%s:%d", vs.ID(), l)
rsiu := getCache(rsiukey)
if rsiu == nil {
- 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 getOHLCVAttr
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
func getOHLCVAttr(stop OHLCV, src OHLCVSeries, dest ValueSeries, p OHLCProp) ValueSeries {
var startt time.Time
firstVal := dest.GetLast()
- 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 DMI
has 8 return statements (exceeds 4 allowed). Open
func DMI(ohlcv OHLCVSeries, len, smoo int) (adx, plus, minus ValueSeries) {
adxkey := fmt.Sprintf("adx:%s:%d:%d", ohlcv.ID(), len, smoo)
adx = getCache(adxkey)
if adx == nil {
adx = NewValueSeries()
Function MFI
has 8 return statements (exceeds 4 allowed). Open
func MFI(o OHLCVSeries, l int64) ValueSeries {
key := fmt.Sprintf("mfi:%s:%d", o.ID(), l)
mfi := getCache(key)
if mfi == nil {
mfi = NewValueSeries()