Showing 53 of 54 total issues
Function anomalyService
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def anomalyService(dimValObj, dfDict, anomalyDefProps, detectionRuleType, detectionParams):
Function minAvgValueOnDimensionalValuesNonRollup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def minAvgValueOnDimensionalValuesNonRollup(
Function valueThresholdDetect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def valueThresholdDetect(df, granularity, operator, value1, value2):
Function cueObserveAnomalyAlert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cueObserveAnomalyAlert(token, channelId, fileImg, title="", message="", details=""):
Function minAvgValueOnDimensionalValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def minAvgValueOnDimensionalValues(
Function topNDimensionalValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def topNDimensionalValues(
Function checkLatestAnomaly
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def checkLatestAnomaly(df):
"""
Looks up latest anomaly in dataframe
"""
anomalies = df[df["anomaly"] == 15]
- 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 too many return
statements within this function. Open
return HttpResponse('Unauthorized', status=401)
Avoid too many return
statements within this function. Open
return
Function getInstallationId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getInstallationId():
""" Function to get installation, if exists or create one"""
try:
res = ApiResponse()
userId = ''.join(random.choices(string.ascii_uppercase + string.digits, k=16))
- 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 editAnomalyDefinition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def editAnomalyDefinition(
anomalyId: int = 0, highOrLow: str = None, detectionRuleParams: dict = {}
):
"""
Update anomaly objects of given anomalyId
- 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 sortOnAnomalyDefinition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sortOnAnomalyDefinition(anomalyDefObjs: List[AnomalyDefinition], sorter):
"""
Sort Anomaly Definition on given user column
"""
columnToSort = sorter.get("columnKey", "")
- 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 webhookAlertHelper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def webhookAlertHelper(
name,
subject,
message,
details="",
- 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"