detain/myadmin-opensrs-domains

View on GitHub

Showing 90 of 90 total issues

The property $error_levels is not named in camelCase.
Open

class OpenSRS
{
    public $id;
    public $cookie;
    public $osrsHandlerAllInfo;
Severity: Minor
Found in src/OpenSRS.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Avoid deeply nested control flow statements.
Open

                                        if (isset($tldPrices[$tld]['new'])) {
                                            $osrsHandler->resultFullRaw['attributes'][$resultType]['items'][$idx]['new'] = bcadd($tldPrices[$tld]['new'], $diff, 2);
                                        }
Severity: Major
Found in src/OpenSRS.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                            if (isset($tldPrices[$tld]['renewal'])) {
                                                $osrsHandler->resultFullRaw['attributes'][$resultType]['items'][$idx]['renewal'] = bcadd($tldPrices[$tld]['renewal'], $diff, 2);
                                            }
    Severity: Major
    Found in src/OpenSRS.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                              if (isset($tldPrices[$tld]['transfer'])) {
                                                  if ($tldPrices[$tld]['transfer'] > 0) {
                                                      $osrsHandler->resultFullRaw['attributes'][$resultType]['items'][$idx]['transfer'] = bcadd($tldPrices[$tld]['transfer'], $diff, 2);
                                                  } else {
                                                      $osrsHandler->resultFullRaw['attributes'][$resultType]['items'][$idx]['transfer'] = 0;
      Severity: Major
      Found in src/OpenSRS.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($db->Record['website_status'] == 'active') {
                                    $website_active = true;
                                }
        Severity: Major
        Found in src/Plugin.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          if (mb_strtoupper($extraInfo['country_of_birth']) == 'FR') {
                                              $extraInfo['place_of_birth'] = $extra['country_of_birth'];
                                              $extraInfo['postal_code_of_birth'] = $extra['country_of_birth'];
                                          }
          Severity: Major
          Found in src/Plugin.php - About 45 mins to fix

            Missing class import via use statement (line '745', column '22').
            Open

                            (new \MyAdmin\Mail())->multiMail($subject, $email, $serviceClass->getEmail(), 'admin/domain_error.tpl');
            Severity: Minor
            Found in src/Plugin.php by phpmd

            MissingImport

            Since: 2.7.0

            Importing all external classes in a file through use statements makes them clearly visible.

            Example

            function make() {
                return new \stdClass();
            }

            Source http://phpmd.org/rules/cleancode.html#MissingImport

            Avoid too many return statements within this method.
            Open

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

              Missing class import via use statement (line '51', column '22').
              Open

                      $addon = new \AddonHandler();
              Severity: Minor
              Found in src/Plugin.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

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

                  Missing class import via use statement (line '399', column '43').
                  Open

                                      $osrsRequestObj = new \opensrs\Request();
                  Severity: Minor
                  Found in src/Plugin.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '658', column '48').
                  Open

                                                  $request = new \opensrs\Request();
                  Severity: Minor
                  Found in src/Plugin.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '698', column '52').
                  Open

                                                      $request = new \opensrs\Request();
                  Severity: Minor
                  Found in src/Plugin.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '619', column '36').
                  Open

                                      $request = new \opensrs\Request();
                  Severity: Minor
                  Found in src/Plugin.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '19', column '19').
                  Open

                      $object = new stdClass();
                  Severity: Minor
                  Found in src/openSRS_loader.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '268', column '36').
                  Open

                                      $request = new \opensrs\Request();
                  Severity: Minor
                  Found in src/Plugin.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

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

                      public static function createNameserverRaw($cookie, $hostname, $ip, $useDomain = false)
                      {
                          if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                              $callstring = [
                                  'func' => 'nsCreate',
                  Severity: Minor
                  Found in src/OpenSRS.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

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

                      public static function response_to_array($array)
                      {
                          $out = [];
                          if (isset($array['attr'])) {
                              $array = [$array];
                  Severity: Minor
                  Found in src/OpenSRS.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

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

                      public static function pollEvent($limit = 1)
                      {
                          $response = self::xmlRequest('EVENT', 'POLL', ['limit'=>$limit]);
                          if ($response['xml_str'] !== false) {
                              //function_requirements('xml2array');
                  Severity: Minor
                  Found in src/OpenSRS.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