condorrocks/condor

View on GitHub

Showing 9 of 200 total issues

Method editMonitor has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function editMonitor($monitorId, $monitorStatus = null, $friendlyName = null, $URL = null, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null)
Severity: Major
Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

    Method newMonitor has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function newMonitor($friendlyName, $URL, $type, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null, $monitorInterval = 5)
    Severity: Major
    Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

      Method editMonitor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function editMonitor($monitorId, $monitorStatus = null, $friendlyName = null, $URL = null, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null)
          {
              $url = $this->base_uri.'/editMonitor?monitorID='.$monitorId;
      
              if (isset($monitorStatus)) {
      Severity: Minor
      Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

        Method newMonitor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function newMonitor($friendlyName, $URL, $type, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null, $monitorInterval = 5)
            {
                if (empty($friendlyName) || empty($URL) || empty($type)) {
                    throw new \Exception('Required key "name", "uri" or "type" not specified', 3);
                }
        Severity: Minor
        Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

          Method getMonitors has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function getMonitors($monitors = null, $customUptimeRatio = null, $logs = 0, $responseTimes = 0, $responseTimesAverage = 0, $alertContacts = 0, $showMonitorAlertContacts = 0, $showTimezone = 0, $search = '')
          Severity: Major
          Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

            Function newMonitor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function newMonitor($friendlyName, $URL, $type, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null, $monitorInterval = 5)
                {
                    if (empty($friendlyName) || empty($URL) || empty($type)) {
                        throw new \Exception('Required key "name", "uri" or "type" not specified', 3);
                    }
            Severity: Minor
            Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

            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 editMonitor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function editMonitor($monitorId, $monitorStatus = null, $friendlyName = null, $URL = null, $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null, $alertContacts = null)
                {
                    $url = $this->base_uri.'/editMonitor?monitorID='.$monitorId;
            
                    if (isset($monitorStatus)) {
            Severity: Minor
            Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

            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 __fetch has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function __fetch($url)
                {
                    if (empty($url)) {
                        throw new \Exception('Value not specified: url', 1);
                    }
            Severity: Minor
            Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 1 hr to fix

              Function __fetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function __fetch($url)
                  {
                      if (empty($url)) {
                          throw new \Exception('Value not specified: url', 1);
                      }
              Severity: Minor
              Found in packages/alariva/uptimerobot/src/UptimeRobot.php - About 45 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language