Showing 22 of 22 total issues
User
has 114 functions (exceeds 20 allowed). Consider refactoring. Open
class User
{
use DateTime;
private $username;
File User.php
has 589 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MadeITBelgium\VestaCP\Object;
/**
WebDomain
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class WebDomain
{
use GeneralDomain;
use DateTime;
Sys
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Sys
{
private $vestacp;
/**
Domain
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Domain
{
private $vestacp;
/**
Function checkResultCode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function checkResultCode($output)
{
switch ($output) {
case 0: return true; break; //Command Successful
- 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 parseUser
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseUser($username, $user)
{
$obj = new self();
$obj->setUsername($username);
$obj->setFirstName($user['FNAME']);
Method call
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function call($command, $returnCode = '', $parameters = [])
{
$requestData = [
'hash' => $this->hash,
'cmd' => $command,
Method parseWebDomain
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseWebDomain($domainname, $data)
{
$obj = new self();
$obj->setDomainname($domainname);
$obj->setIp($data['IP']);
Method createDNSRecord
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createDNSRecord($user, $domain, $record, $type, $value, $priority = null, $id = null, $restart = null)
Method create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function create($user, $database, $dbuser, $dbpass, $type = null, $host = null, $charset = null)
Function call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function call($command, $returnCode = '', $parameters = [])
{
$requestData = [
'hash' => $this->hash,
'cmd' => $command,
- 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 createDNS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createDNS($user, $domain, $ip, $ipv6, $ns = [], $restart = null)
Method create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function create($user, $password, $email, $package = null, $firstname = null, $lastname = null)
Method changeDNSRecord
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function changeDNSRecord($user, $domain, $id, $value, $priority = null)
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function create($user, $domain, $ip = null, $ipv6 = null, $restart = null)
Method createFtp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createFtp($user, $domain, $ftp_user, $ftp_password, $ftp_path = null)
Method createMailAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createMailAccount($user, $domain, $account, $password, $quota = null)
Function create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create($user, $domain, $ip = null, $ipv6 = null, $restart = null)
{
$request = [$user, $domain];
if (!empty($ip)) {
$request[] = $ip;
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create($user, $database, $dbuser, $dbpass, $type = null, $host = null, $charset = null)
{
$request = [$user, $database, $dbuser, $dbpass];
if ($type != null) {
$request[] = $type;
- 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"