cuebook/CueObserve

View on GitHub

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):
Severity: Minor
Found in api/anomaly/services/alerts.py - About 35 mins to fix

    Function topNDimensionalValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def topNDimensionalValues(
    Severity: Minor
    Found in api/access/utils.py - About 35 mins to fix

      Function _anomalyDetectionForValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _anomalyDetectionForValue(
      Severity: Minor
      Found in api/ops/tasks/rootCauseAnalysis.py - About 35 mins to fix

        Function anomalyService has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def anomalyService(dimValObj, dfDict, anomalyDefProps, detectionRuleType, detectionParams):
        Severity: Minor
        Found in api/ops/tasks/detection/core/anomalyDetection.py - About 35 mins to fix

          Function minAvgValueOnDimensionalValuesNonRollup has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def minAvgValueOnDimensionalValuesNonRollup(
          Severity: Minor
          Found in api/access/utils.py - About 35 mins to fix

            Function cueObserveAnomalyAlert has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def cueObserveAnomalyAlert(token, channelId, fileImg, title="", message="", details=""):
            Severity: Minor
            Found in alerts-api/src/alerts.py - About 35 mins to fix

              Function valueThresholdDetect has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def valueThresholdDetect(df, granularity, operator, value1, value2):
              Severity: Minor
              Found in api/ops/tasks/detection/core/detectionTypes/valueThreshold.py - About 35 mins to fix

                Function webhookAlertHelper has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def webhookAlertHelper(
                Severity: Minor
                Found in api/anomaly/services/alerts.py - About 35 mins to fix

                  Function _anomalyDetectionSubTask has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def _anomalyDetectionSubTask(dimValObj, dfDict, anomalyDefProps, detectionRuleType, detectionParams):
                  Severity: Minor
                  Found in api/ops/tasks/anomalyDetectionTasks.py - About 35 mins to fix

                    Function contributionOnDimensionalValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def contributionOnDimensionalValues(
                    Severity: Minor
                    Found in api/access/utils.py - About 35 mins to fix

                      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]
                      Severity: Minor
                      Found in api/ops/tasks/detection/core/detectionTypes/prophet.py - About 35 mins to fix

                      Avoid too many return statements within this function.
                      Open

                      return HttpResponse('Unauthorized', status=401)
                      Severity: Major
                      Found in api/app/middlewares.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                        return
                        Severity: Major
                        Found in api/app/middlewares.py - About 30 mins to fix

                          Function webhookAlertHelper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def webhookAlertHelper(
                          name,
                          subject,
                          message,
                          details="",
                          Severity: Minor
                          Found in api/anomaly/services/alerts.py - About 25 mins to fix

                          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
                          Severity: Minor
                          Found in api/anomaly/services/anomalyDefinitions.py - About 25 mins to fix

                          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))
                          Severity: Minor
                          Found in api/anomaly/services/telemetry.py - About 25 mins to fix

                          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", "")
                          Severity: Minor
                          Found in api/anomaly/services/anomalyDefinitions.py - About 25 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language