Showing 16 of 16 total issues
Method updateAsset
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def updateAsset(sAssetType=nil,sAssetOid=nil,sName=nil,xxValues=nil,yTagType=nil)
aValues = normalizeValues(xxValues)
# Validate Tag Type
yTagType = yTagType.to_sym if yTagType.is_a?(String)
- 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
Method getAsset
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def getAsset(xAssetId1, xAssetId2 = nil)
xAssetId1.strip!
if xAssetId1 =~ /^([^:]+):([0-9]+)$/
sAssetType = $1
- 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
Method getJsondocForXmlAssetNode
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def getJsondocForXmlAssetNode(oNodeAsset=nil)
if oNodeAsset.nil?
raise RuntimeError, 'E_NIL_NODE'
end
oAsset = VersiononeSdk::Asset.new
- 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
Method getAssetNodeChildPropVal
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def getAssetNodeChildPropVal(oNodeChild=nil)
xxPropVal = nil
aPropVals = []
if oNodeChild.children.length > 0
oNodeChild.children.each do |oNodeChildGrand|
- 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
Method updateAsset
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def updateAsset(sAssetType=nil,sAssetOid=nil,sName=nil,xxValues=nil,yTagType=nil)
aValues = normalizeValues(xxValues)
# Validate Tag Type
yTagType = yTagType.to_sym if yTagType.is_a?(String)
Method getJsondocForXmlAssetNode
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getJsondocForXmlAssetNode(oNodeAsset=nil)
if oNodeAsset.nil?
raise RuntimeError, 'E_NIL_NODE'
end
oAsset = VersiononeSdk::Asset.new
Method normalizeValues
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def normalizeValues(xxValues=nil)
aValues = []
if xxValues.is_a?(String)
aValues = [{value: xxValues, act: 'set'}]
- 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
Method getAsset
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getAsset(xAssetId1, xAssetId2 = nil)
xAssetId1.strip!
if xAssetId1 =~ /^([^:]+):([0-9]+)$/
sAssetType = $1
Method initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(opts = {})
@sProtocol = opts[:protocol] || DEFAULT_PROTOCOL
@sHostname = opts[:hostname] || DEFAULT_HOSTNAME
@iPort = opts.key?(:port) && opts[:port] \
? opts[:port].to_i : DEFAULT_PORT
- 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
Method buildUrl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def buildUrl(sProtocol = DEFAULT_PROTOCOL, sHostname = DEFAULT_HOSTNAME, iPort = DEFAULT_PORT)
if sHostname.nil?
sHostname = 'localhost'
elsif sHostname.is_a?(String)
sHostname.strip!
- 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
Avoid deeply nested control flow statements. Open
sAssetType = @dTypePrefix.key?(sAssetTypeAbbr) \
? @dTypePrefix[ sAssetTypeAbbr ] : ''
Avoid deeply nested control flow statements. Open
elsif xAssetId1 =~ /^[a-zA-Z].+$/
return self.getAssetForTypeAndOid(xAssetId1, xAssetId2)
Method updateAsset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def updateAsset(sAssetType=nil,sAssetOid=nil,sName=nil,xxValues=nil,yTagType=nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(dValues=nil,dSchema=nil,bDefaultifyDoc=false,bIsStrict=true,opts={})
Method updateAsset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def updateAsset(sAssetType=nil,sAssetOid=nil,sName=nil,xxValues=nil,yTagType=nil)
Method inflateNames
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def inflateNames()
dAssetState = {
0 => 'Future',
64 => 'Active',
128 => 'Closed',
- 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"