Showing 8 of 83 total issues
Method loadProcessing
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function loadProcessing(GenericEvent $event)
{
/**
* @var \ServiceHandler $service
*/
Method api_buy_vps_admin
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function api_buy_vps_admin($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass, $server = 0)
{
if ($GLOBALS['tf']->ima != 'admin') {
$server = 0;
} else {
Method doSliceEnable
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function doSliceEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
{
$deferUpgradeViaTicket = true;
$serviceInfo = $serviceOrder->getServiceInfo();
$serviceTypes = run_event('get_service_types', false, self::$module);
Method api_buy_vps
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function api_buy_vps($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass)
{
$custid = get_custid($GLOBALS['tf']->session->account_id, 'vps');
function_requirements('validate_buy_vps');
$validation = validate_buy_vps($custid, $os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass);
Method api_buy_vps_admin
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function api_buy_vps_admin($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass, $server = 0)
Method api_buy_vps
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function api_buy_vps($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass)
Method api_validate_buy_vps
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function api_validate_buy_vps($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass)
Function doSliceEnable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function doSliceEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
{
$deferUpgradeViaTicket = true;
$serviceInfo = $serviceOrder->getServiceInfo();
$serviceTypes = run_event('get_service_types', false, 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"