Showing 37 of 54 total issues
Function webookAnomalyAlert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def webookAnomalyAlert(url, message, details, subject, anomalyDefId, anomalyId):
Function cueObserveAnomalyAlert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cueObserveAnomalyAlert(token, channelId, fileImg, title="", message="", details=""):
Function contributionOnDimensionalValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def contributionOnDimensionalValues(
Function topNDimensionalValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def topNDimensionalValues(
Function minAvgValueOnDimensionalValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def minAvgValueOnDimensionalValues(
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 webhookAlertHelper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def webhookAlertHelper(
Function _anomalyDetectionSubTask
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _anomalyDetectionSubTask(dimValObj, dfDict, anomalyDefProps, detectionRuleType, detectionParams):
Function detect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def detect(df, granularity, detectionRuleType, detectionParams, limit=None):
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 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 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"
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 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"