qcubed/framework

View on GitHub
assets/php/_devtools/jquery_ui_gen/jq_control.php

Summary

Maintainability
F
3 days
Test Coverage

The method php_value() contains an eval expression.
Open

            if (@eval($jsValue. ';') === false) {

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 class Option has an overall complexity of 62 which is very high. The configured complexity threshold is 50.
Open

class Option extends JqAttributes {
    public $type;
    public $phpType;
    public $defaultValue = null;
    public $propName;

File jq_control.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
//include_once('simple_html_dom.php');
require('qcubed.inc.php');
require(__INCLUDES__ . '/codegen/QCodeGen.class.php');

Severity: Minor
Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 2 hrs to fix

    Function __construct has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct($name, $origName, $signature, $description) {
            parent::__construct($origName, $description);
            $this->name = ucfirst($name);
            $signature = str_replace("\n", '', $signature);
            $this->signature = $signature;
    Severity: Minor
    Found in assets/php/_devtools/jquery_ui_gen/jq_control.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 __construct has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($name, $origName, $signature, $description) {
            parent::__construct($origName, $description);
            $this->name = ucfirst($name);
            $signature = str_replace("\n", '', $signature);
            $this->signature = $signature;
    Severity: Minor
    Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 1 hr to fix

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

          static public function php_type($jsType) {
              $jsType = strtolower($jsType);
              $jsType = preg_replace('/\([^\)]*\)/', '', $jsType); // erase possible function args
              if (strchr($jsType, ',')) return 'mixed';
              if (strchr($jsType, ' or ')) return 'mixed';
      Severity: Minor
      Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 1 hr to fix

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

            public function __construct($strJqClass = null, $strJqSetupFunc = null, $strQcClass = null, $strQcBaseClass = 'QPanel')
            {
                $this->strJqClass = $strJqClass;
        
                if ($strJqSetupFunc === null) {
        Severity: Minor
        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 55 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct($propName, $origName, $jsType, $defaultValue, $description, $phpType = null) {
        Severity: Minor
        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 45 mins to fix

          Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct($strQcClass, $name, $origName, $jsType, $description, $phpType = null) {
          Severity: Minor
          Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 45 mins to fix

            Avoid too many return statements within this method.
            Open

                    case 'selector': return 'mixed';
            Severity: Major
            Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      default: return 'mix';
              Severity: Major
              Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return null;
                Severity: Major
                Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          case 'object[]': return 'object[]';
                  Severity: Major
                  Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            case 'double': return 'flt';
                    Severity: Major
                    Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              case 'double': return 'float';
                      Severity: Major
                      Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                case 'boolean': return 'boolean';
                        Severity: Major
                        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  case 'object': return 'mixed';
                          Severity: Major
                          Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    case 'number[]': return 'int[]';
                            Severity: Major
                            Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      case 'int[]': return 'int[]';
                              Severity: Major
                              Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        case 'QDateTime': return 'QType::DateTime';
                                Severity: Major
                                Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          default: return "'".$phpType."'";
                                  Severity: Major
                                  Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            case 'int': return 'integer';
                                    Severity: Major
                                    Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              case 'integer': return 'int';
                                      Severity: Major
                                      Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                case 'integer[]': return 'int[]';
                                        Severity: Major
                                        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  case 'double[]': return 'float[]';
                                          Severity: Major
                                          Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                    case 'string[]': return 'string[]';
                                            Severity: Major
                                            Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                      case 'QDateTime': return 'dtt';
                                              Severity: Major
                                              Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        case 'string': return 'string';
                                                Severity: Major
                                                Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                          case 'date': return 'QDateTime';
                                                  Severity: Major
                                                  Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            case 'integer': return 'integer';
                                                    Severity: Major
                                                    Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                              case 'options': return 'array';
                                                      Severity: Major
                                                      Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                case 'array[]': return 'array[]';
                                                        Severity: Major
                                                        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  case 'float': return 'float';
                                                          Severity: Major
                                                          Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                    case 'double': return 'QType::Float';
                                                            Severity: Major
                                                            Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                      case 'number': return 'integer';
                                                              Severity: Major
                                                              Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                        case 'array': return 'arr';
                                                                Severity: Major
                                                                Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                          case 'boolean[]': return 'boolean[]';
                                                                  Severity: Major
                                                                  Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                            case 'array': return 'QType::ArrayType';
                                                                    Severity: Major
                                                                    Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                              return $jsValue;
                                                                      Severity: Major
                                                                      Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                case 'float[]': return 'float[]';
                                                                        Severity: Major
                                                                        Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                  case 'date[]': return 'QDateTime[]';
                                                                          Severity: Major
                                                                          Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                    default: return 'QJsClosure';
                                                                            Severity: Major
                                                                            Found in assets/php/_devtools/jquery_ui_gen/jq_control.php - About 30 mins to fix

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

                                                                                  static public function php_value($jsValue) {
                                                                                      //todo: add proper parsing
                                                                                      $jsValue = trim($jsValue);
                                                                                      if (!$jsValue)
                                                                                          return null;
                                                                              Severity: Minor
                                                                              Found in assets/php/_devtools/jquery_ui_gen/jq_control.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 php_type() has a Cyclomatic Complexity of 26. The configured cyclomatic complexity threshold is 10.
                                                                              Open

                                                                                  static public function php_type($jsType) {
                                                                                      $jsType = strtolower($jsType);
                                                                                      $jsType = preg_replace('/\([^\)]*\)/', '', $jsType); // erase possible function args
                                                                                      if (strchr($jsType, ',')) return 'mixed';
                                                                                      if (strchr($jsType, ' or ')) return 'mixed';

                                                                              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

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

                                                                                      $html = new \Html2Text\Html2Text($description);

                                                                              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

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

                                                                                  static public function php_value($jsValue) {
                                                                                      //todo: add proper parsing
                                                                                      $jsValue = trim($jsValue);
                                                                                      if (!$jsValue)
                                                                                          return null;

                                                                              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 '312', column '12').
                                                                              Open

                                                                                      $r = new ReflectionClass($this->strQcBaseClass);

                                                                              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 jq_indent has a boolean flag argument $blnComment, which is a certain sign of a Single Responsibility Principle violation.
                                                                              Open

                                                                              function jq_indent ($strText, $intCount, $blnComment = false) {

                                                                              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                              Open

                                                                                      } else {
                                                                                          $this->strJqSetupFunc = $strJqSetupFunc;
                                                                                      }

                                                                              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                              Open

                                                                                      } else {
                                                                                          $this->eventName = $jsType;
                                                                                      }

                                                                              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                              Open

                                                                                      } else {
                                                                                          $this->strQcClass = $strQcClass;
                                                                                      }

                                                                              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                              Open

                                                                                          else {
                                                                                              $this->phpSignature .= '$'.$arg;
                                                                                              $this->requiredArgs[] = '$'.$arg;
                                                                                          }

                                                                              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

                                                                              TODO found
                                                                              Open

                                                                                              // TODO: better handle variable length argument list

                                                                              Avoid excessively long variable names like $strOutDirControlsBase. Keep variable name length under 20.
                                                                              Open

                                                                                  public function GenerateControl($objJqDoc, $strOutDirControls, $strOutDirControlsBase) {

                                                                              LongVariable

                                                                              Since: 0.2

                                                                              Detects when a field, formal or local variable is declared with a long name.

                                                                              Example

                                                                              class Something {
                                                                                  protected $reallyLongIntName = -3; // VIOLATION - Field
                                                                                  public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                                                      $otherReallyLongName = -5; // VIOLATION - Local
                                                                                      for ($interestingIntIndex = 0; // VIOLATION - For
                                                                                           $interestingIntIndex < 10;
                                                                                           $interestingIntIndex++ ) {
                                                                                      }
                                                                                  }
                                                                              }

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

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

                                                                                      $i = 1;

                                                                              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 $r. Configured minimum length is 3.
                                                                              Open

                                                                                      $r = new ReflectionClass($this->strQcBaseClass);

                                                                              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 variable $unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 $unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 $unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 $unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 $unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 reset_names is not named in camelCase.
                                                                              Open

                                                                                  protected function reset_names() {
                                                                                      $this->names = array();
                                                                                  }

                                                                              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 unique_name is not named in camelCase.
                                                                              Open

                                                                                  protected function unique_name($name) {
                                                                                      $i = 1;
                                                                                      $unique_name = $name;
                                                                                      while ($this->has_name($unique_name)) {
                                                                                          $unique_name = $name.$i;

                                                                              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 php_qtype is not named in camelCase.
                                                                              Open

                                                                                  static public function php_qtype($phpType) {
                                                                                      $phpType = str_replace('[]', '', $phpType);
                                                                                      switch ($phpType) {
                                                                                      case 'boolean': return 'QType::Boolean';
                                                                                      case 'string': return 'QType::String';

                                                                              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 GenerateControl is not named in camelCase.
                                                                              Open

                                                                                  public function GenerateControl($objJqDoc, $strOutDirControls, $strOutDirControlsBase) {
                                                                                      $mixArgumentArray = array('objJqDoc' => $objJqDoc);
                                                                                      $strResult = $this->EvaluatePHP(dirname(__FILE__) . '/jq_control.tpl.php', $mixArgumentArray);
                                                                                      $strOutFileName = $strOutDirControlsBase . '/'.$objJqDoc->strQcClass . 'Gen.class.php';
                                                                                      file_put_contents($strOutFileName, $strResult);

                                                                              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 has_name is not named in camelCase.
                                                                              Open

                                                                                  protected function has_name($name) {
                                                                                      return array_key_exists($name, $this->names);
                                                                                  }

                                                                              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 add_name is not named in camelCase.
                                                                              Open

                                                                                  protected function add_name($name) {
                                                                                      $this->names[$name] = $name;
                                                                                  }

                                                                              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 php_type is not named in camelCase.
                                                                              Open

                                                                                  static public function php_type($jsType) {
                                                                                      $jsType = strtolower($jsType);
                                                                                      $jsType = preg_replace('/\([^\)]*\)/', '', $jsType); // erase possible function args
                                                                                      if (strchr($jsType, ',')) return 'mixed';
                                                                                      if (strchr($jsType, ' or ')) return 'mixed';

                                                                              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 php_type_suffix is not named in camelCase.
                                                                              Open

                                                                                  static public function php_type_suffix($phpType) {
                                                                                      if (strpos($phpType, '[]') !== false)
                                                                                          return 'Array';
                                                                                      return '';
                                                                                  }

                                                                              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 php_type_prefix is not named in camelCase.
                                                                              Open

                                                                                  static public function php_type_prefix($phpType) {
                                                                                      $phpType = str_replace('[]', '', $phpType);
                                                                                      switch ($phpType) {
                                                                                      case 'boolean': return 'bln';
                                                                                      case 'string': return 'str';

                                                                              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 php_value is not named in camelCase.
                                                                              Open

                                                                                  static public function php_value($jsValue) {
                                                                                      //todo: add proper parsing
                                                                                      $jsValue = trim($jsValue);
                                                                                      if (!$jsValue)
                                                                                          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

                                                                              There are no issues that match your filters.

                                                                              Category
                                                                              Status