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)
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)
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)) {
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);
}
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 = '')
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);
}
- 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 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)) {
- 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 __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);
}
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);
}
- 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"