Asymptix/Framework

View on GitHub

Showing 129 of 720 total issues

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

    public static function selectSingleRecord($query, $types = "", $params = []) {
        if (!Tools::isInstanceOf($query, new DBPreparedQuery())) {
            $dbQuery = new DBPreparedQuery($query, $types, $params);
        } else {
            $dbQuery = $query;
Severity: Minor
Found in framework/db/DBCore.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function uniqueListing() {
        fwrite($this->connection, "UIDL\r\n");
        $response = "";

        while (true) {
Severity: Minor
Found in framework/mail/POP.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public static function selectSingleValue($query, $types = "", $params = []) {
        if (!Tools::isInstanceOf($query, new DBPreparedQuery())) {
            $dbQuery = new DBPreparedQuery($query, $types, $params);
        } else {
            $dbQuery = $query;
Severity: Minor
Found in framework/db/DBCore.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function prepareOrder() {
        if (!empty($this->order)) {
            $this->query.= " ORDER BY";
            if (is_array($this->order)) {
                foreach ($this->order as $fieldName => $ord) {
Severity: Minor
Found in framework/db/DBPreparedQuery.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public static function selectDBObjectFromStatement($stmt, $className) {
        if (is_object($className)) {
            $className = get_class($className);
        }

Severity: Minor
Found in framework/db/DBCore.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function updateAvatar($newAvatarFileName) {
        $currentAvatarFileName = $this->avatar;
        if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) {
            unlink(Config::DIR_AVATARS . $currentAvatarFileName);
        }
Severity: Minor
Found in classes/db/access/User.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function parseHeader($header) {
        $avar = explode("\n", $header);
        $len = count($avar);
        $ret = $L2 = $L3 = null;
        for ($i = 0; $i < $len; $i++) {
Severity: Minor
Found in framework/mail/POP.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Avoid too many return statements within this method.
Open

                return $this->getFieldValue($fieldName);
Severity: Major
Found in framework/db/DBSelector.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return 'E_CORE_WARNING';
    Severity: Major
    Found in classes/db/tools/ErrorLog.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return 'E_STRICT';
      Severity: Major
      Found in classes/db/tools/ErrorLog.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return "";
        Severity: Major
        Found in classes/db/tools/ErrorLog.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $this->selectDBObject();
          Severity: Major
          Found in framework/db/DBSelector.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                        return $geoData;
            Severity: Major
            Found in framework/tools/geo/LocationDetector.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return 'E_DEPRECATED';
              Severity: Major
              Found in classes/db/tools/ErrorLog.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return "s";
                Severity: Major
                Found in framework/db/DBField.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return 'E_USER_NOTICE';
                  Severity: Major
                  Found in classes/db/tools/ErrorLog.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return null;
                    Severity: Major
                    Found in framework/tools/geo/LocationDetector.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                                  return @$geoData->geoplugin_regionName;
                      Severity: Major
                      Found in framework/tools/geo/LocationDetector.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                                    return [
                                                        'country' => @$geoData->geoplugin_countryName,
                                                        'country_code' => @$geoData->geoplugin_countryCode
                                                    ];
                        Severity: Major
                        Found in framework/tools/geo/LocationDetector.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return 'E_USER_DEPRECATED';
                          Severity: Major
                          Found in classes/db/tools/ErrorLog.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language