detain/myadmin-plesk-webhosting

View on GitHub

Showing 41 of 102 total issues

Method deleteSubscription has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function deleteSubscription($params)
    {
        $xmldoc = new \DomDocument('1.0', 'UTF-8');
        $xmldoc->formatOutput = true;
        $packet = $xmldoc->createElement('packet');
Severity: Minor
Found in src/Plesk.php - About 1 hr to fix

    Function deleteSite has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function deleteSite($params)
        {
            $xmldoc = new \DomDocument('1.0', 'UTF-8');
            $xmldoc->formatOutput = true;
            $packet = $xmldoc->createElement('packet');
    Severity: Minor
    Found in src/Plesk.php - About 1 hr 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

    Function updateSite has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateSite($params)
        {
            $xmldoc = new \DomDocument('1.0', 'UTF-8');
            $xmldoc->formatOutput = true;
            $packet = $xmldoc->createElement('packet');
    Severity: Minor
    Found in src/Plesk.php - About 1 hr 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

    Method getErrorCodes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getErrorCodes()
        {
            return [
                1001 => 'Authentication failed - wrong password.',
                1002 => 'User account  already exists.',
    Severity: Minor
    Found in src/Plesk.php - About 1 hr to fix

      Method deleteSite has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function deleteSite($params)
          {
              $xmldoc = new \DomDocument('1.0', 'UTF-8');
              $xmldoc->formatOutput = true;
              $packet = $xmldoc->createElement('packet');
      Severity: Minor
      Found in src/Plesk.php - About 1 hr to fix

        Method deleteClient has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function deleteClient($params)
            {
                $xmldoc = new \DomDocument('1.0', 'UTF-8');
                $xmldoc->formatOutput = true;
                $packet = $xmldoc->createElement('packet');
        Severity: Minor
        Found in src/Plesk.php - About 1 hr to fix

          Method listClients has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function listClients()
              {
                  $xmldoc = new \DomDocument('1.0', 'UTF-8');
                  $xmldoc->formatOutput = true;
                  $packet = $xmldoc->createElement('packet');
          Severity: Minor
          Found in src/Plesk.php - About 1 hr to fix

            Method getWebspaces has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getWebspaces($hosting = true, $limits = true, $stat = true, $prefs = true)
                {
                    $xmldoc = new \DomDocument('1.0', 'UTF-8');
                    $xmldoc->formatOutput = true;
                    $packet = $xmldoc->createElement('packet');
            Severity: Minor
            Found in src/Plesk.php - About 1 hr to fix

              Method getClient has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getClient($params)
                  {
                      $xmldoc = new \DomDocument('1.0', 'UTF-8');
                      $xmldoc->formatOutput = true;
                      $packet = $xmldoc->createElement('packet');
              Severity: Minor
              Found in src/Plesk.php - About 1 hr to fix

                Method getTerminate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getTerminate(GenericEvent $event)
                    {
                        if ($event['category'] == get_service_define('WEB_PLESK')) {
                            $event->stopPropagation();
                            $serviceClass = $event->getSubject();
                Severity: Minor
                Found in src/Plugin.php - About 1 hr to fix

                  Method getServerInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getServerInfo()
                      {
                          $xmldoc = new \DomDocument('1.0', 'UTF-8');
                          $xmldoc->formatOutput = true;
                          $packet = $xmldoc->createElement('packet');
                  Severity: Minor
                  Found in src/Plesk.php - About 1 hr to fix

                    Method createMailAccount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function createMailAccount($params)
                        {
                            $xmldoc = new \DomDocument('1.0', 'UTF-8');
                            $xmldoc->formatOutput = true;
                    
                    
                    Severity: Minor
                    Found in src/Plesk.php - About 1 hr to fix

                      Method createSession has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function createSession($user)
                          {
                              $xmldoc = new \DomDocument('1.0', 'UTF-8');
                              $xmldoc->formatOutput = true;
                              $packet = $xmldoc->createElement('packet');
                      Severity: Minor
                      Found in src/Plesk.php - About 1 hr to fix

                        Function listClients has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function listClients()
                            {
                                $xmldoc = new \DomDocument('1.0', 'UTF-8');
                                $xmldoc->formatOutput = true;
                                $packet = $xmldoc->createElement('packet');
                        Severity: Minor
                        Found in src/Plesk.php - About 55 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

                        Function fixResult has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function fixResult($result)
                            {
                                if (is_array($result)) {
                                    $tempResult = $result;
                                    foreach ($tempResult as $key => $value) {
                        Severity: Minor
                        Found in src/Plesk.php - About 55 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

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

                            public function deleteSubscription($params)
                            {
                                $xmldoc = new \DomDocument('1.0', 'UTF-8');
                                $xmldoc->formatOutput = true;
                                $packet = $xmldoc->createElement('packet');
                        Severity: Minor
                        Found in src/Plesk.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

                        Function getTerminate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function getTerminate(GenericEvent $event)
                            {
                                if ($event['category'] == get_service_define('WEB_PLESK')) {
                                    $event->stopPropagation();
                                    $serviceClass = $event->getSubject();
                        Severity: Minor
                        Found in src/Plugin.php - About 35 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

                        Avoid too many return statements within this method.
                        Open

                                        return;
                        Severity: Major
                        Found in src/Plugin.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return;
                          Severity: Major
                          Found in src/Plugin.php - About 30 mins to fix

                            Function deleteClient has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function deleteClient($params)
                                {
                                    $xmldoc = new \DomDocument('1.0', 'UTF-8');
                                    $xmldoc->formatOutput = true;
                                    $packet = $xmldoc->createElement('packet');
                            Severity: Minor
                            Found in src/Plesk.php - About 25 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