Showing 10 of 10 total issues
Function render
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function render(Exception $e)
{
switch ($e->message) {
case 1:
$return = redirect()->back()->withErrors(['Not enough arguments provided']);
- 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 render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function render(Exception $e)
{
switch ($e->message) {
case 1:
$return = redirect()->back()->withErrors(['Not enough arguments provided']);
Method send
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function send($cmd)
{
$postVars = [
'user' => $this->userName,
'password' => $this->key,
Method editCron
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function editCron($job, $min, $hour, $day, $month, $wday, $cmd)
Method regUser
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function regUser($username, $password, $email, $package, $fistName, $lastName)
Method addCron
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addCron($min, $hour, $day, $month, $wday, $cmd)
Method addDNSDomain
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addDNSDomain($domain, $ip, $ns1, $ns2, $ns3 = null, $ns4 = null)
Method addDateBase
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addDateBase($database, $dbuser, $password, $type, $charset)
Method addDNSRecord
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addDNSRecord($domain, $rec, $type, $val, $priority)
Function send
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function send($cmd)
{
$postVars = [
'user' => $this->userName,
'password' => $this->key,
- 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"