detain/myadmin-vps-module

View on GitHub

Showing 8 of 83 total issues

Method loadProcessing has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function loadProcessing(GenericEvent $event)
    {
        /**
         * @var \ServiceHandler $service
         */
Severity: Major
Found in src/Plugin.php - About 2 hrs to fix

    Method api_buy_vps_admin has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    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 {
    Severity: Minor
    Found in src/api.php - About 1 hr to fix

      Method doSliceEnable has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function doSliceEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
          {
              $deferUpgradeViaTicket = true;
              $serviceInfo = $serviceOrder->getServiceInfo();
              $serviceTypes = run_event('get_service_types', false, self::$module);
      Severity: Minor
      Found in src/Plugin.php - About 1 hr to fix

        Method api_buy_vps has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        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);
        Severity: Minor
        Found in src/api.php - About 1 hr to fix

          Method api_buy_vps_admin has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function api_buy_vps_admin($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass, $server = 0)
          Severity: Major
          Found in src/api.php - About 1 hr to fix

            Method api_buy_vps has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function api_buy_vps($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass)
            Severity: Major
            Found in src/api.php - About 1 hr to fix

              Method api_validate_buy_vps has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function api_validate_buy_vps($os, $slices, $platform, $controlpanel, $period, $location, $version, $hostname, $coupon, $rootpass)
              Severity: Major
              Found in src/api.php - About 1 hr to fix

                Function doSliceEnable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function doSliceEnable(\ServiceHandler $serviceOrder, $repeatInvoiceId, $regexMatch = false)
                    {
                        $deferUpgradeViaTicket = true;
                        $serviceInfo = $serviceOrder->getServiceInfo();
                        $serviceTypes = run_event('get_service_types', false, self::$module);
                Severity: Minor
                Found in src/Plugin.php - About 45 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language