XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/includes/class.CommonFunctions.inc.php

Summary

Maintainability
F
1 wk
Test Coverage

The method _findProgram() contains an eval expression.
Open

                    $arrPath = array_merge(eval(PSI_ADD_PATHS), $arrPath); // In this order so $addpaths is before $arrPath when looking for a program

EvalExpression

Since: 0.2

An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            eval('$param = 23;');
        }
    }
}

Source https://phpmd.org/rules/design.html#evalexpression

The method getPlugins() contains an eval expression.
Open

                return eval(strtolower(PSI_PLUGINS));

EvalExpression

Since: 0.2

An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            eval('$param = 23;');
        }
    }
}

Source https://phpmd.org/rules/design.html#evalexpression

The method executeProgram() contains an eval expression.
Open

                $sudocommands = eval(PSI_SUDO_COMMANDS);

EvalExpression

Since: 0.2

An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            eval('$param = 23;');
        }
    }
}

Source https://phpmd.org/rules/design.html#evalexpression

readenv accesses the super-global variable $_SERVER.
Open

    public static function readenv($strElem, &$strBuffer)
    {
        $strBuffer = '';
        if (PSI_OS == 'WINNT') { //case insensitive
            if (isset($_SERVER)) {

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

readenv accesses the super-global variable $_SERVER.
Open

    public static function readenv($strElem, &$strBuffer)
    {
        $strBuffer = '';
        if (PSI_OS == 'WINNT') { //case insensitive
            if (isset($_SERVER)) {

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

readenv accesses the super-global variable $_SERVER.
Open

    public static function readenv($strElem, &$strBuffer)
    {
        $strBuffer = '';
        if (PSI_OS == 'WINNT') { //case insensitive
            if (isset($_SERVER)) {

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

readenv accesses the super-global variable $_SERVER.
Open

    public static function readenv($strElem, &$strBuffer)
    {
        $strBuffer = '';
        if (PSI_OS == 'WINNT') { //case insensitive
            if (isset($_SERVER)) {

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Function executeProgram has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
    {
        if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
            $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
            if ($out == false) {
Severity: Minor
Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 day 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

File class.CommonFunctions.inc.php has 549 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * common Functions class
 *
 * PHP version 5
Severity: Major
Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 day to fix

    Function _findProgram has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function _findProgram($strProgram)
        {
            $path_parts = pathinfo($strProgram);
            if (empty($path_parts['basename'])) {
                return null;
    Severity: Minor
    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 day 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 rfts has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
        {
            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                $out = self::_parse_log_file("Reading: ".$strFileName);
                if ($out == false) {
    Severity: Minor
    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 7 hrs 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 getWMI has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getWMI($wmi, $strClass, $strValue = array())
        {
            $arrData = array();
            if (gettype($wmi) === "object") {
                $value = "";
    Severity: Minor
    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 5 hrs 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 enumKey has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
        {
            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
    
            $arrBuffer = array();
    Severity: Minor
    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 5 hrs 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 executeProgram has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
        {
            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                if ($out == false) {
    Severity: Major
    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 4 hrs to fix

      The class CommonFunctions has an overall complexity of 210 which is very high. The configured complexity threshold is 50.
      Open

      class CommonFunctions
      {
          /**
           * holds codepage for chcp
           *

      Method _findProgram has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function _findProgram($strProgram)
          {
              $path_parts = pathinfo($strProgram);
              if (empty($path_parts['basename'])) {
                  return null;
      Severity: Major
      Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 3 hrs to fix

        Function _timeoutfgets has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
            {
                $w = null;
                $e = null;
                $te = false;
        Severity: Minor
        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs 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 readReg has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true)
            {
                $strBuffer = '';
                if ($reg === false) {
                    $last = strrpos($strName, "\\");
        Severity: Minor
        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs 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 _parse_log_file has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function _parse_log_file($string)
            {
                if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                    $log_file = substr(PSI_LOG, 1);
                    if (file_exists($log_file)) {
        Severity: Minor
        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs 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 gdc has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function gdc($strPath, $booErrorRep = true)
            {
                $arrDirectoryContent = array();
                $error = PSI_Error::singleton();
                if (is_dir($strPath)) {
        Severity: Minor
        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs 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 rfts has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
            {
                if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                    $out = self::_parse_log_file("Reading: ".$strFileName);
                    if ($out == false) {
        Severity: Major
        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 2 hrs to fix

          Function readenv has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function readenv($strElem, &$strBuffer)
              {
                  $strBuffer = '';
                  if (PSI_OS == 'WINNT') { //case insensitive
                      if (isset($_SERVER)) {
          Severity: Minor
          Found in phpsysinfo/includes/class.CommonFunctions.inc.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 enumKey has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
              {
                  $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
          
                  $arrBuffer = array();
          Severity: Minor
          Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

            Function fileexists has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function fileexists($strFileName)
                {
                    if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                        $log_file = substr(PSI_LOG, 1);
                        if (file_exists($log_file)
            Severity: Minor
            Found in phpsysinfo/includes/class.CommonFunctions.inc.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 getWMI has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getWMI($wmi, $strClass, $strValue = array())
                {
                    $arrData = array();
                    if (gettype($wmi) === "object") {
                        $value = "";
            Severity: Minor
            Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

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

                  private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
                  {
                      $w = null;
                      $e = null;
                      $te = false;
              Severity: Minor
              Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

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

                    public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true)
                    {
                        $strBuffer = '';
                        if ($reg === false) {
                            $last = strrpos($strName, "\\");
                Severity: Minor
                Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

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

                      public static function checkForExtensions($arrExt = array())
                      {
                          if ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))
                              $arrReq = array('simplexml', 'pcre', 'xml', 'dom');
                          elseif (PSI_OS == "WINNT")
                  Severity: Minor
                  Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

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

                        public static function checkForExtensions($arrExt = array())
                        {
                            if ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))
                                $arrReq = array('simplexml', 'pcre', 'xml', 'dom');
                            elseif (PSI_OS == "WINNT")
                    Severity: Minor
                    Found in phpsysinfo/includes/class.CommonFunctions.inc.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

                    Method executeProgram has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                    Severity: Minor
                    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 35 mins to fix

                      Method rfts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
                      Severity: Minor
                      Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 35 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $return_value == 0;
                        Severity: Major
                        Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return false;
                          Severity: Major
                          Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return true;
                            Severity: Major
                            Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return false;
                              Severity: Major
                              Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return true;
                                Severity: Major
                                Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return true;
                                  Severity: Major
                                  Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 30 mins to fix

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

                                        public static function getPlugins()
                                        {
                                            if (defined('PSI_PLUGINS') && is_string(PSI_PLUGINS)) {
                                                if (preg_match(ARRAY_EXP, PSI_PLUGINS)) {
                                                    return eval(strtolower(PSI_PLUGINS));
                                    Severity: Minor
                                    Found in phpsysinfo/includes/class.CommonFunctions.inc.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

                                    The method _findProgram() has an NPath complexity of 310400. The configured NPath complexity threshold is 200.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    NPathComplexity

                                    Since: 0.1

                                    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                    Example

                                    class Foo {
                                        function bar() {
                                            // lots of complicated code
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                    The method rfts() has an NPath complexity of 304. The configured NPath complexity threshold is 200.
                                    Open

                                        public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Reading: ".$strFileName);
                                                if ($out == false) {

                                    NPathComplexity

                                    Since: 0.1

                                    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                    Example

                                    class Foo {
                                        function bar() {
                                            // lots of complicated code
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                    The method executeProgram() has 126 lines of code. Current threshold is set to 100. Avoid really long methods.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    The method executeProgram() has an NPath complexity of 2156544. The configured NPath complexity threshold is 200.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    NPathComplexity

                                    Since: 0.1

                                    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                    Example

                                    class Foo {
                                        function bar() {
                                            // lots of complicated code
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                    The method _findProgram() has a Cyclomatic Complexity of 31. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method _parse_log_file() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method readenv() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function readenv($strElem, &$strBuffer)
                                        {
                                            $strBuffer = '';
                                            if (PSI_OS == 'WINNT') { //case insensitive
                                                if (isset($_SERVER)) {

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method getWMI() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function getWMI($wmi, $strClass, $strValue = array())
                                        {
                                            $arrData = array();
                                            if (gettype($wmi) === "object") {
                                                $value = "";

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method rfts() has a Cyclomatic Complexity of 24. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Reading: ".$strFileName);
                                                if ($out == false) {

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method readReg() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true)
                                        {
                                            $strBuffer = '';
                                            if ($reg === false) {
                                                $last = strrpos($strName, "\\");

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method _timeoutfgets() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
                                        {
                                            $w = null;
                                            $e = null;
                                            $te = false;

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method enumKey() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method executeProgram() has a Cyclomatic Complexity of 39. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    The method fileexists() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    CyclomaticComplexity

                                    Since: 0.1

                                    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                    Example

                                    // Cyclomatic Complexity = 11
                                    class Foo {
                                    1   public function example() {
                                    2       if ($a == $b) {
                                    3           if ($a1 == $b1) {
                                                    fiddle();
                                    4           } elseif ($a2 == $b2) {
                                                    fiddle();
                                                } else {
                                                    fiddle();
                                                }
                                    5       } elseif ($c == $d) {
                                    6           while ($c == $d) {
                                                    fiddle();
                                                }
                                    7        } elseif ($e == $f) {
                                    8           for ($n = 0; $n < $h; $n++) {
                                                    fiddle();
                                                }
                                            } else {
                                                switch ($z) {
                                    9               case 1:
                                                        fiddle();
                                                        break;
                                    10              case 2:
                                                        fiddle();
                                                        break;
                                    11              case 3:
                                                        fiddle();
                                                        break;
                                                    default:
                                                        fiddle();
                                                        break;
                                                }
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$serverpath' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::readenv('PATH', $serverpath)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$serverpath' which will lead to PHP notices.
                                    Open

                                                        $arrPath = preg_split('/;/', $serverpath, -1, PREG_SPLIT_NO_EMPTY);

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                                            $exceptPath = $windir."\\SysWOW64"; //64-bit PHP on 64-bit Windows

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$serverpath' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::readenv('Path', $serverpath)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                                    if ((strtolower($strPath) == $windir."\\system32") && is_dir($windir."\\SysWOW64")) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                                    if ((strtolower($strPath) == $windir."\\system32") && is_dir($windir."\\SysWOW64")) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                            if ((PSI_OS == 'WINNT') && CommonFunctions::readenv('WinDir', $windir)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                                        if (is_dir($windir."\\sysnative")) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$windir' which will lead to PHP notices.
                                    Open

                                                            $exceptPath = $windir."\\sysnative"; //32-bit PHP on 64-bit Windows

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$serverpath' which will lead to PHP notices.
                                    Open

                                                        $arrPath = preg_split('/:/', $serverpath, -1, PREG_SPLIT_NO_EMPTY);

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Avoid using undefined variables such as '$strBuf' which will lead to PHP notices.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    UndefinedVariable

                                    Since: 2.8.0

                                    Detects when a variable is used that has not been defined before.

                                    Example

                                    class Foo
                                    {
                                        private function bar()
                                        {
                                            // $message is undefined
                                            echo $message;
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                    Remove error control operator '@' on line 45.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    ErrorControlOperator

                                    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                                    Example

                                    function foo($filePath) {
                                        $file = @fopen($filPath); // hides exceptions
                                        $key = @$array[$notExistingKey]; // assigns null to $key
                                    }

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

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

                                                    $sub_keys = new VARIANT();

                                    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

                                    The method gdc has a boolean flag argument $booErrorRep, which is a certain sign of a Single Responsibility Principle violation.
                                    Open

                                        public static function gdc($strPath, $booErrorRep = true)

                                    BooleanArgumentFlag

                                    Since: 1.4.0

                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                    Example

                                    class Foo {
                                        public function bar($flag = true) {
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                    The method executeProgram has a boolean flag argument $booErrorRep, which is a certain sign of a Single Responsibility Principle violation.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)

                                    BooleanArgumentFlag

                                    Since: 1.4.0

                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                    Example

                                    class Foo {
                                        public function bar($flag = true) {
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                    The method readReg has a boolean flag argument $booErrorRep, which is a certain sign of a Single Responsibility Principle violation.
                                    Open

                                        public static function readReg($reg, $strName, &$strBuffer, $booErrorRep = true)

                                    BooleanArgumentFlag

                                    Since: 1.4.0

                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                    Example

                                    class Foo {
                                        public function bar($flag = true) {
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                    The method enumKey has a boolean flag argument $booErrorRep, which is a certain sign of a Single Responsibility Principle violation.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)

                                    BooleanArgumentFlag

                                    Since: 1.4.0

                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                    Example

                                    class Foo {
                                        public function bar($flag = true) {
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                    The method rfts has a boolean flag argument $booErrorRep, which is a certain sign of a Single Responsibility Principle violation.
                                    Open

                                        public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)

                                    BooleanArgumentFlag

                                    Since: 1.4.0

                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                    Example

                                    class Foo {
                                        public function bar($flag = true) {
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                    Remove error control operator '@' on line 437.
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    ErrorControlOperator

                                    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                                    Example

                                    function foo($filePath) {
                                        $file = @fopen($filPath); // hides exceptions
                                        $key = @$array[$notExistingKey]; // assigns null to $key
                                    }

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

                                    Avoid using static access to class 'CommonFunctions' in method '_findProgram'.
                                    Open

                                                    if (CommonFunctions::readenv('Path', $serverpath)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method _parse_log_file uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                            } else {
                                                                return substr($contents, $startIndex);
                                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method rolv uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                return null;
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid assigning values to variables in if clauses and the like (line '382', column '21').
                                    Open

                                        public static function rfts($strFileName, &$strRet, $intLines = 0, $intBytes = 4096, $booErrorRep = true)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Reading: ".$strFileName);
                                                if ($out == false) {

                                    IfStatementAssignment

                                    Since: 2.7.0

                                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($foo = 'bar') { // possible typo
                                                // ...
                                            }
                                            if ($baz = 0) { // always false
                                                // ...
                                            }
                                        }
                                    }

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

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        if ($booErrorRep) {
                                                            $error->addError('fopen('.$strFileName.')', 'file can not read by phpsysinfo');
                                                        }
                                    
                                    

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if ($booErrorRep) {
                                                        $error->addError('fopen('.$strFileName.')', 'file permission error');
                                                    }
                                    
                                    

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'PSI_Error' in method 'gdc'.
                                    Open

                                            $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                $strSet = '';
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method getWMI uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                            } else {
                                                                if (in_array($propItem->Name, $strValue)) {
                                                                    if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);
                                                                    else $arrInstance[$propItem->Name] = $value;
                                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method getPlugins uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    return array(strtolower(PSI_PLUGINS));
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method readReg uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {
                                                        $strBuffer = $buffer2[1];
                                                    } else {
                                                        return false;

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'enumKey'.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $strPath = rtrim($strPath, "/");
                                                    $strPathS = $strPath."/";
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        $return_value = proc_close($process);
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'rolv'.
                                    Open

                                            if (CommonFunctions::fileexists($filename) && CommonFunctions::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method enumKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {
                                                        foreach ($buffer2[1] as $sub_key) {
                                                            $arrBuffer[] = trim($sub_key);
                                                        }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid assigning values to variables in if clauses and the like (line '339', column '56').
                                    Open

                                        public static function readenv($strElem, &$strBuffer)
                                        {
                                            $strBuffer = '';
                                            if (PSI_OS == 'WINNT') { //case insensitive
                                                if (isset($_SERVER)) {

                                    IfStatementAssignment

                                    Since: 2.7.0

                                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($foo = 'bar') { // possible typo
                                                // ...
                                            }
                                            if ($baz = 0) { // always false
                                                // ...
                                            }
                                        }
                                    }

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

                                    Avoid using static access to class 'PSI_Error' in method 'rfts'.
                                    Open

                                            $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method getPlugins uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                return array();
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method '_findProgram'.
                                    Open

                                            if ((PSI_OS == 'WINNT') && CommonFunctions::readenv('WinDir', $windir)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                            } else {
                                                                error_log("---".gmdate('r T')."--- Reading: ".$strFileName."\n".$strRet, 3, PSI_LOG);
                                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method fileexists uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if (substr(PSI_LOG, 0, 1)=="-") {
                                                        return false;
                                                    }
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'PSI_Error' in method 'readReg'.
                                    Open

                                                        $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method enumKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        return false;
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method gdc uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                if ($booErrorRep) {
                                                    $error->addError('is_dir('.$strPath.')', 'directory does not exist on your machine');
                                                }
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _timeoutfgets uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $read = array($pipes[1]);
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'readReg'.
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method readReg uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        return false;
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'enumKey'.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $strBuffer = $out;
                                    
                                                    return true;
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'PSI_Error' in method 'executeProgram'.
                                    Open

                                            $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $process = $pipes[1] = popen($strSet.$strProgram.$strArgs." 2>/dev/null", "r");
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    fclose($pipes[0]);
                                                    fclose($pipes[1]);
                                                    fclose($pipes[2]);
                                                    // It is important that you close any pipes before calling

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                if (preg_match('/\s/', $strProgram)) {
                                                    $strProgram = '"'.$strProgram.'"';
                                                }
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $strRet = $out;
                                    
                                                    return true;
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                if ($booErrorRep) {
                                                    $error->addError('file_exists('.$strFileName.')', 'the file does not exist on your machine');
                                                }
                                    
                                    

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method enumKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                   return false;
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    array_push($arrPath, '/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin');
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'PSI_Error' in method 'getWMI'.
                                    Open

                                                        $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    Avoid using static access to class 'PSI_Error' in method 'enumKey'.
                                    Open

                                                            $error = PSI_Error::singleton();

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    Avoid assigning values to variables in if clauses and the like (line '437', column '21').
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    IfStatementAssignment

                                    Since: 2.7.0

                                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($foo = 'bar') { // possible typo
                                                // ...
                                            }
                                            if ($baz = 0) { // always false
                                                // ...
                                            }
                                        }
                                    }

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

                                    The method gdc uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if ($booErrorRep) {
                                                        $error->addError('opendir('.$strPath.')', 'directory can not be read by phpsysinfo');
                                                    }
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                        } else {
                                                            $exceptPath = $windir."\\SysWOW64"; //64-bit PHP on 64-bit Windows
                                                        }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                $process = proc_open($strSet.$strProgram.$strArgs, $descriptorspec, $pipes);
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _timeoutfgets uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                $pipe2 = true;
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    if (CommonFunctions::readenv('PATH', $serverpath)) {
                                                        $arrPath = preg_split('/:/', $serverpath, -1, PREG_SPLIT_NO_EMPTY);
                                                    }
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        $arrPath = array_merge(array(PSI_ADD_PATHS), $arrPath); // In this order so $addpaths is before $arrPath when looking for a program
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid assigning values to variables in if clauses and the like (line '310', column '115').
                                    Open

                                        public static function rolv($similarFileName, $match = "//", $replace = "")
                                        {
                                            $filename = preg_replace($match, $replace, $similarFileName);
                                            if (CommonFunctions::fileexists($filename) && CommonFunctions::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) {
                                                return $buf;

                                    IfStatementAssignment

                                    Since: 2.7.0

                                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($foo = 'bar') { // possible typo
                                                // ...
                                            }
                                            if ($baz = 0) { // always false
                                                // ...
                                            }
                                        }
                                    }

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

                                    The method enumKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        return false;
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method readenv uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                if (isset($_SERVER[$strElem]) && is_string($value = $_SERVER[$strElem]) && (trim($value) !== '')) {
                                                    $strBuffer = $value;
                                    
                                                    return true;

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method readReg uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        return false;
                                                    }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                    } else {
                                                        if (preg_match('/\s/', $sudoProgram)) {
                                                            $strProgram = '"'.$sudoProgram.'" '.$strProgram;
                                                        } else {
                                                            $strProgram = $sudoProgram.' '.$strProgram;

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else {
                                                if ($booErrorRep) {
                                                    $error->addError($strProgram, "\nOpen process error");
                                                }
                                    
                                    

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid assigning values to variables in if clauses and the like (line '470', column '17').
                                    Open

                                        public static function gdc($strPath, $booErrorRep = true)
                                        {
                                            $arrDirectoryContent = array();
                                            $error = PSI_Error::singleton();
                                            if (is_dir($strPath)) {

                                    IfStatementAssignment

                                    Since: 2.7.0

                                    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($foo = 'bar') { // possible typo
                                                // ...
                                            }
                                            if ($baz = 0) { // always false
                                                // ...
                                            }
                                        }
                                    }

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

                                    Avoid using static access to class 'CommonFunctions' in method '_findProgram'.
                                    Open

                                                    if (CommonFunctions::readenv('PATH', $serverpath)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                            } else { //directory defined
                                                array_push($arrPath, $path_parts['dirname']);
                                                $strProgram = $path_parts['basename'];
                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                        } else {
                                                            $strProgram = $sudoProgram.' '.$strProgram;
                                                        }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'rolv'.
                                    Open

                                            if (CommonFunctions::fileexists($filename) && CommonFunctions::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method rfts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                            } else {
                                                                $intCurLine++;
                                                            }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    Avoid using static access to class 'CommonFunctions' in method 'readReg'.
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    StaticAccess

                                    Since: 1.4.0

                                    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                    Example

                                    class Foo
                                    {
                                        public function bar()
                                        {
                                            Bar::baz();
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#staticaccess

                                    The method _findProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $strProgrammpath = $strPathS.$strProgram;
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method executeProgram uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                    Open

                                                } else {
                                                    $sudocommands = array(PSI_SUDO_COMMANDS);
                                                }

                                    ElseExpression

                                    Since: 1.4.0

                                    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                    Example

                                    class Foo
                                    {
                                        public function bar($flag)
                                        {
                                            if ($flag) {
                                                // one branch
                                            } else {
                                                // another branch
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/cleancode.html#elseexpression

                                    The method checkForExtensions() contains an exit expression.
                                    Open

                                                die();

                                    ExitExpression

                                    Since: 0.2

                                    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                                    Example

                                    class Foo {
                                        public function bar($param)  {
                                            if ($param === 42) {
                                                exit(23);
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/design.html#exitexpression

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                    if ($contents && preg_match("/^\-\-\-[^-\r\n]+\-\-\- ".preg_quote($string, '/')."\r?\n/m", $contents, $matches, PREG_OFFSET_CAPTURE)) {
                                                        $findIndex = $matches[0][1];
                                                        if (preg_match("/\r?\n/m", $contents, $matches, PREG_OFFSET_CAPTURE, $findIndex)) {
                                                            $startIndex = $matches[0][1]+1;
                                                            if (preg_match("/^\-\-\-[^-\r\n]+\-\-\- /m", $contents, $matches, PREG_OFFSET_CAPTURE, $startIndex)) {
                                    Severity: Major
                                    Found in phpsysinfo/includes/class.CommonFunctions.inc.php and 1 other location - About 5 hrs to fix
                                    phpsysinfo/tools/checkdistro.php on lines 49..61

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 185.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Each class must be in a namespace of at least one level (a top-level vendor name)
                                    Open

                                    class CommonFunctions

                                    Avoid variables with short names like $cp. Configured minimum length is 3.
                                    Open

                                        public static function setcp($cp)

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    The property $_cp is not named in camelCase.
                                    Open

                                    class CommonFunctions
                                    {
                                        /**
                                         * holds codepage for chcp
                                         *

                                    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 variables with short names like $te. Configured minimum length is 3.
                                    Open

                                            $te = false;

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $b. Configured minimum length is 3.
                                    Open

                                        public static function name_natural_compare($a, $b)

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $te. Configured minimum length is 3.
                                    Open

                                                $te = self::_timeoutfgets($pipes, $strBuffer, $strError, $timeout);

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $a. Configured minimum length is 3.
                                    Open

                                        public static function name_natural_compare($a, $b)

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $fd. Configured minimum length is 3.
                                    Open

                                                    if ($fd = fopen($strFileName, 'r')) {

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $e. Configured minimum length is 3.
                                    Open

                                            $e = null;

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $n. Configured minimum length is 3.
                                    Open

                                                $n = stream_select($read, $w, $e, $timeout);

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Avoid variables with short names like $w. Configured minimum length is 3.
                                    Open

                                            $w = null;

                                    ShortVariable

                                    Since: 0.2

                                    Detects when a field, local, or parameter has a very short name.

                                    Example

                                    class Something {
                                        private $q = 15; // VIOLATION - Field
                                        public static function main( array $as ) { // VIOLATION - Formal
                                            $r = 20 + $this->q; // VIOLATION - Local
                                            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                $r += $this->q;
                                            }
                                        }
                                    }

                                    Source https://phpmd.org/rules/naming.html#shortvariable

                                    Method name "_parse_log_file" should not be prefixed with an underscore to indicate visibility
                                    Open

                                        private static function _parse_log_file($string)

                                    Expected 1 space before "=>"; 0 found
                                    Open

                                                    foreach ($_SERVER as $index=>$value) {

                                    Method name "CommonFunctions::_parse_log_file" is not in camel caps format
                                    Open

                                        private static function _parse_log_file($string)

                                    Method name "_timeoutfgets" should not be prefixed with an underscore to indicate visibility
                                    Open

                                        private static function _timeoutfgets($pipes, &$out, &$err, $timeout)

                                    Property name "$_cp" should not be prefixed with an underscore to indicate visibility
                                    Open

                                        private static $_cp = null;

                                    Each PHP statement must be on a line by itself
                                    Open

                                                            $error->addError("enumKey()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));;

                                    Method name "_findProgram" should not be prefixed with an underscore to indicate visibility
                                    Open

                                        private static function _findProgram($strProgram)

                                    Method name "CommonFunctions::name_natural_compare" is not in camel caps format
                                    Open

                                        public static function name_natural_compare($a, $b)

                                    Expected 1 space after "=>"; 0 found
                                    Open

                                                    foreach ($_SERVER as $index=>$value) {

                                    Inline control structures are not allowed
                                    Open

                                            else

                                    Line exceeds 120 characters; contains 135 characters
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)

                                    Line exceeds 120 characters; contains 134 characters
                                    Open

                                                            $value = $objItem->{$propItem->Name}; //instead exploitable eval("\$value = \$objItem->".$propItem->Name.";");

                                    Line exceeds 120 characters; contains 126 characters
                                    Open

                                                            if (preg_match("/^\-\-\-[^-\r\n]+\-\-\- /m", $contents, $matches, PREG_OFFSET_CAPTURE, $startIndex)) {

                                    Line exceeds 120 characters; contains 142 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && (substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0, 1)!="+")) {

                                    Line exceeds 120 characters; contains 281 characters
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    Line exceeds 120 characters; contains 125 characters
                                    Open

                                                error_log("---".gmdate('r T')."--- Executing: ".trim($strProgramname.$strArgs)."\n".$strBuffer."\n", 3, PSI_LOG);

                                    Inline control structures are not allowed
                                    Open

                                                                if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);

                                    Line exceeds 120 characters; contains 132 characters
                                    Open

                                                        $error->addError("getWMI()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));

                                    Line exceeds 120 characters; contains 327 characters
                                    Open

                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);

                                    Line exceeds 120 characters; contains 132 characters
                                    Open

                                     * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

                                    Inline control structures are not allowed
                                    Open

                                            if ((strcasecmp(PSI_SYSTEM_CODEPAGE, "UTF-8") == 0) || (strcasecmp(PSI_SYSTEM_CODEPAGE, "CP437") == 0))

                                    Inline control structures are not allowed
                                    Open

                                                                else $arrInstance[$propItem->Name] = $value;

                                    Line exceeds 120 characters; contains 144 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {

                                    Line exceeds 120 characters; contains 154 characters
                                    Open

                                                        if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && (substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0, 1)!="+")) {

                                    Line exceeds 120 characters; contains 144 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {

                                    Line exceeds 120 characters; contains 135 characters
                                    Open

                                                    $text .= "    <Message>phpSysInfo requires the ".$extension." extension to php in order to work properly.</Message>\n";

                                    Line exceeds 120 characters; contains 291 characters
                                    Open

                                                    if (CommonFunctions::executeProgram('cmd', '/c chcp '.CommonFunctions::$_cp.' && reg query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    Line exceeds 120 characters; contains 138 characters
                                    Open

                                                            $error->addError("enumKey()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));;

                                    Line exceeds 120 characters; contains 133 characters
                                    Open

                                                        $error->addError("readReg()", preg_replace('/<br\/>/', "\n", preg_replace('/<b>|<\/b>/', '', $e->getMessage())));

                                    Line exceeds 120 characters; contains 150 characters
                                    Open

                                                        $arrPath = array_merge(eval(PSI_ADD_PATHS), $arrPath); // In this order so $addpaths is before $arrPath when looking for a program

                                    Inline control structures are not allowed
                                    Open

                                            elseif (PSI_OS == "WINNT")

                                    Line exceeds 120 characters; contains 250 characters
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.substr($strName, 0, $last).'" /v '.$keyname.' 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match("/^\s*".$keyname."\s+REG_\S+\s+(.+)\s*$/mi", $strBuf, $buffer2)) {

                                    Line exceeds 120 characters; contains 142 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && (substr(PSI_LOG, 0, 1)!="-") && (substr(PSI_LOG, 0, 1)!="+")) {

                                    Line exceeds 120 characters; contains 132 characters
                                    Open

                                     * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

                                    Line exceeds 120 characters; contains 144 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {

                                    Line exceeds 120 characters; contains 151 characters
                                    Open

                                                        $arrPath = array_merge(array(PSI_ADD_PATHS), $arrPath); // In this order so $addpaths is before $arrPath when looking for a program

                                    Line exceeds 120 characters; contains 140 characters
                                    Open

                                            if (CommonFunctions::fileexists($filename) && CommonFunctions::rfts($filename, $buf, 1, 4096, false) && (($buf=trim($buf)) != "")) {

                                    Line exceeds 120 characters; contains 144 characters
                                    Open

                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {

                                    Inline control structures are not allowed
                                    Open

                                                                    else $arrInstance[$propItem->Name] = $value;

                                    Line exceeds 120 characters; contains 240 characters
                                    Open

                                                    if (CommonFunctions::executeProgram('reg', 'query "'.$strName.'" 2>&1', $strBuf, $booErrorRep) && (strlen($strBuf) > 0) && preg_match_all("/^".preg_replace("/\\\\/", "\\\\\\\\", $strName)."\\\\(.*)/mi", $strBuf, $buffer2)) {

                                    Line exceeds 120 characters; contains 151 characters
                                    Open

                                                    if ($contents && preg_match("/^\-\-\-[^-\r\n]+\-\-\- ".preg_quote($string, '/')."\r?\n/m", $contents, $matches, PREG_OFFSET_CAPTURE)) {

                                    Inline control structures are not allowed
                                    Open

                                                                    if (is_string($value)) $arrInstance[$propItem->Name] = trim($value);

                                    Line indented incorrectly; expected at least 16 spaces, found 15
                                    Open

                                                   return false;

                                    Expected 1 space after ELSE keyword; newline found
                                    Open

                                            else

                                    Line indented incorrectly; expected at least 20 spaces, found 19
                                    Open

                                                       $key->EnumKey(strval($_hkey[$hkey]), substr($strName, $first+1), $sub_keys);

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $path_parts is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $return_value is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $return_value is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_keys is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $return_value is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $return_value is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_keys is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_keys is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $cnt_args is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $log_file is not named in camelCase.
                                    Open

                                        public static function fileexists($strFileName)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $return_value is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $_hkey is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $_hkey is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $_hkey is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $cnt_args is not named in camelCase.
                                    Open

                                        public static function executeProgram($strProgramname, $strArgs, &$strBuffer, $booErrorRep = true, $timeout = PSI_EXEC_TIMEOUT_INT)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $out = self::_parse_log_file("Executing: ".trim($strProgramname.' '.$strArgs));
                                                if ($out == false) {

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The variable $sub_key is not named in camelCase.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();

                                    CamelCaseVariableName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function doSomething() {
                                            $data_module = new DataModule();
                                        }
                                    }

                                    Source

                                    The method _parse_log_file is not named in camelCase.
                                    Open

                                        private static function _parse_log_file($string)
                                        {
                                            if (defined('PSI_LOG') && is_string(PSI_LOG) && (strlen(PSI_LOG)>0) && ((substr(PSI_LOG, 0, 1)=="-") || (substr(PSI_LOG, 0, 1)=="+"))) {
                                                $log_file = substr(PSI_LOG, 1);
                                                if (file_exists($log_file)) {

                                    CamelCaseMethodName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function get_name() {
                                        }
                                    }

                                    Source

                                    The method _findProgram is not named in camelCase.
                                    Open

                                        private static function _findProgram($strProgram)
                                        {
                                            $path_parts = pathinfo($strProgram);
                                            if (empty($path_parts['basename'])) {
                                                return null;

                                    CamelCaseMethodName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function get_name() {
                                        }
                                    }

                                    Source

                                    The method name_natural_compare is not named in camelCase.
                                    Open

                                        public static function name_natural_compare($a, $b)
                                        {
                                            return strnatcmp($a->getName(), $b->getName());
                                        }

                                    CamelCaseMethodName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function get_name() {
                                        }
                                    }

                                    Source

                                    The method _timeoutfgets is not named in camelCase.
                                    Open

                                        private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
                                        {
                                            $w = null;
                                            $e = null;
                                            $te = false;

                                    CamelCaseMethodName

                                    Since: 0.2

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

                                    Example

                                    class ClassName {
                                        public function get_name() {
                                        }
                                    }

                                    Source

                                    There are no issues that match your filters.

                                    Category
                                    Status