Showing 11 of 96 total issues
RobotClient
has 109 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class RobotClient extends RobotRestClient
{
const VERSION = '2018.06';
/**
File RobotClient.php
has 708 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Client class for robot webservice
*
Method orderServer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function orderServer($productId, $location, array $authorizedKeys = array(), $password = null, $dist = null, $arch = null, $lang = null, $test = false)
{
$url = $this->baseUrl . '/order/server/transaction';
$data = array('product_id' => $productId);
$data['location'] = $location;
Method orderServer
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function orderServer($productId, $location, array $authorizedKeys = array(), $password = null, $dist = null, $arch = null, $lang = null, $test = false)
Method linuxActivate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function linuxActivate($ip, $dist, $arch, $lang, array $authorizedKeys = array())
Method cpanelActivate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function cpanelActivate($ip, $dist, $arch, $lang, $hostname)
Method pleskActivate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function pleskActivate($ip, $dist, $arch, $lang, $hostname)
Method firewallCreateOrUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function firewallCreateOrUpdate($ip, $status, $whitelistHos, array $rules, $port = 'main')
Method firewallTemplateUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function firewallTemplateUpdate($templateId, $name, $whitelistHos, $isDefault, $rules)
Function executeRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function executeRequest()
{
$result = parent::executeRequest();
if ($result['response'] === false)
- 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 orderServer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function orderServer($productId, $location, array $authorizedKeys = array(), $password = null, $dist = null, $arch = null, $lang = null, $test = false)
{
$url = $this->baseUrl . '/order/server/transaction';
$data = array('product_id' => $productId);
$data['location'] = $location;
- 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"