Asymptix/Framework

View on GitHub

Showing 720 of 720 total issues

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

                    $fieldsList[$field] = [
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$extra' which will lead to PHP notices.
Open

                        'extra' => $extra,
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$type' which will lead to PHP notices.
Open

                    $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$key' which will lead to PHP notices.
Open

                        'key' => $key,
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$key' which will lead to PHP notices.
Open

                    $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$field' which will lead to PHP notices.
Open

                    $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$type' which will lead to PHP notices.
Open

                        'type' => $type,
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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 '$comment' which will lead to PHP notices.
Open

                        'comment' => $comment
Severity: Minor
Found in framework/db/DBCore.php by phpmd

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

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

    public static function getLanguages() {
        if (is_null(self::$langs)) {
            self::$langs = [
                'en' => new Language('en', [
                    'en' => "English",
Severity: Minor
Found in framework/localization/Languages.php - About 1 hr to fix

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

        public static function getSQLCondition($queryCondition, $operator = "") {
            $operator = strtoupper(trim($operator));
            if ($operator === "OR" || $operator === "AND") {
                if (is_array($queryCondition)) {
                    if ($operator === "AND") {
    Severity: Minor
    Found in framework/db/DBQueryCondition.php - About 1 hr to fix

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

          public function start() {
              switch ($this->direction) {
                  case (self::TO_OUTPUT_STREAM):
                      OutputStream::start();
      
      
      Severity: Minor
      Found in framework/tools/logging/Logger.php - About 1 hr to fix

        Function checkAccountAccess has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function checkAccountAccess($roles = array()) {
                global $_USER;
        
                if (self::checkLoggedIn()) {
                    if (empty($roles)) {
        Severity: Minor
        Found in classes/db/access/User.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function prepareLimit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function prepareLimit() {
                $count = null;
                if (!is_null($this->limit)) {
                    if (Tools::isInteger($this->limit)) {
                        $this->query.= " LIMIT " . $this->limit;
        Severity: Minor
        Found in framework/db/DBPreparedQuery.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function css has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function css($propertyName, $propertyValue = null) {
                if (is_null($propertyValue)) {
                    if (isset($this->style[$propertyName])) {
                        return $this->style[$propertyName];
                    }
        Severity: Minor
        Found in framework/ui/UIComponent.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 sqlConditionType has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function sqlConditionType($conditionType) {
                $conditionType = preg_replace("#[[:blank:]]{2,}#", " ", strtolower(trim($conditionType)));
        
                $conditionTypes = [
                    // Equal operator
        Severity: Minor
        Found in framework/db/DBQueryCondition.php - About 1 hr to fix

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

              private static function getPrintableSQLValue($type, $value) {
                  if (strpos($type, "varchar") === 0
                   || strpos($type, "text") === 0
                   || strpos($type, "longtext") === 0
                   || strpos($type, "enum") === 0
          Severity: Minor
          Found in framework/db/DBCore.php - About 1 hr to fix

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

                public static function castFieldValue($fieldName, $type) {
                    global $_FIELDS;
            
                    if (isset($_FIELDS[$fieldName])) {
                        switch ($type) {
            Severity: Minor
            Found in framework/web/Request.php - About 1 hr to fix

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

                  public function open($host = "localhost", $port = 110, $username = "", $password = "") {
                      $sock = fsockopen($host, $port);
              
                      if ($sock) {
                          fgets($sock, 1024);
              Severity: Minor
              Found in framework/mail/POP.php - About 1 hr to fix

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

                    public static function showQueryDebugInfo($query = "", $types = "", array $params = []) {
                        OutputStream::start();
                        if (!empty($query)) {
                            if (empty($types) && empty($params)) {
                                OutputStream::message(OutputStream::MSG_INFO, "Q: " . $query);
                Severity: Minor
                Found in framework/db/DBQuery.php - About 1 hr to fix

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

                      public static function start($name = "", array $iniSettings = [], $useCookie = false,
                              $lifetime = null, $path = null, $domain = null, $secure = null, $httponly = null)
                      {
                          if (!empty($iniSettings)) {
                              foreach ($iniSettings as $key => $value) {
                  Severity: Minor
                  Found in framework/web/Session.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language