Showing 16 of 16 total issues
Method getActivate
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getActivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
myadmin_log(self::$module, 'info', 'PleskAutomation Activation', __LINE__, __FILE__, self::$module, $serviceClass->getId());
File Plugin.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Detain\MyAdminPleskAutomation;
use Detain\MyAdminPleskAutomation\PPAConnector;
Function getActivate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getActivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
myadmin_log(self::$module, 'info', 'PleskAutomation Activation', __LINE__, __FILE__, self::$module, $serviceClass->getId());
- 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 get_pleskautomation_info_from_domain
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_pleskautomation_info_from_domain($hostname)
{
$module = 'webhosting';
$settings = \get_module_settings($module);
$db = get_module_db($module);
Method getTerminate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTerminate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$event->stopPropagation();
$serviceClass = $event->getSubject();
Function getTerminate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function getTerminate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$event->stopPropagation();
$serviceClass = $event->getSubject();
- 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 getDeactivate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getDeactivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
myadmin_log(self::$module, 'info', 'PleskAutomation Deactivation', __LINE__, __FILE__, self::$module, $serviceClass->getId());
Method getReactivate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getReactivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
$serverdata = get_service_master($serviceClass->getServer(), self::$module);
Function getDeactivate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getDeactivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
myadmin_log(self::$module, 'info', 'PleskAutomation Deactivation', __LINE__, __FILE__, self::$module, $serviceClass->getId());
- 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 getReactivate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getReactivate(GenericEvent $event)
{
if ($event['category'] == get_service_define('WEB_PPA')) {
$serviceClass = $event->getSubject();
$serverdata = get_service_master($serviceClass->getServer(), self::$module);
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return [$accountId, $memberId, $subscriptoinId, $webspaceId];
Function get_pleskautomation_info_from_domain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get_pleskautomation_info_from_domain($hostname)
{
$module = 'webhosting';
$settings = \get_module_settings($module);
$db = get_module_db($module);
- 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
TODO found Open
* @TODO Double Check The Server To Ensure The Site Isnt There And Our Information Is Correct, If Not Then Update It With Correect Info And Use That To Terminate Instead.
- Exclude checks