Showing 45 of 125 total issues

Function select has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function select(string $table = null, $columnFields = '*', ...$conditions)
    {
        $getFromTable = $this->fromTable;
        $getSelect_result = $this->select_result;
        $getIsInto = $this->isInto;
Severity: Minor
Found in lib/ezQuery.php - About 5 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function _query_insert_replace has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    private function _query_insert_replace($table = '', $keyValue = null, $type = '', $execute = true)
    {
        if ((!\is_array($keyValue) && ($execute)) || empty($table)) {
            return $this->clearPrepare();
        }
Severity: Minor
Found in lib/ezQuery.php - About 5 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function debug has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function debug($print_to_screen = true)
    {
        // Start output buffering
        \ob_start();

Severity: Minor
Found in lib/ezsqlModel.php - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function processQueryResult has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    private function processQueryResult(string $query, $result = null)
    {
        $this->shortcutUsed = false;

        if (!empty($result))
Severity: Minor
Found in lib/Database/ez_sqlsrv.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function processResult has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function processResult(string $query, $result = null, bool $isSelect = false)
    {
        $this->shortcutUsed = false;

        // If there is an error then take note of it..
Severity: Minor
Found in lib/Database/ez_pdo.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function get_datatype has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_datatype($col)
    {
        $datatype = "dt not defined";
        if (isset($col->typeid)) {
            switch ($col->typeid) {
Severity: Minor
Found in lib/Database/ez_sqlsrv.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function processQueryResult has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private function processQueryResult(string $query, $result = null)
    {
        $this->shortcutUsed = false;

        if (!empty($result))
Severity: Minor
Found in lib/Database/ez_pgsql.php - About 3 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 select has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function select(string $table = null, $columnFields = '*', ...$conditions)
    {
        $getFromTable = $this->fromTable;
        $getSelect_result = $this->select_result;
        $getIsInto = $this->isInto;
Severity: Major
Found in lib/ezQuery.php - About 3 hrs to fix

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

        public function query(string $query, bool $use_prepare = false)
        {
            $param = [];
            if ($use_prepare) {
                $param = $this->prepareValues();
    Severity: Minor
    Found in lib/Database/ez_pgsql.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        private function fetch_prepared_result(&$stmt, $query)
        {
            if ($stmt instanceof \mysqli_stmt) {
                $stmt->store_result();
                $variables = array();
    Severity: Minor
    Found in lib/Database/ez_mysqli.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        private function processQuery(string $query, array $param = null)
        {
            // Query was an insert, delete, update, replace
            if (\preg_match("/^(insert|delete|update|replace|drop|create)\s+/i", $query)) {
                // Perform the query and log number of affected rows
    Severity: Minor
    Found in lib/Database/ez_pdo.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        protected function getDependencies($parameters, $values = null)
        {
            $dependencies = [];
            if (\is_array($parameters)) {
                foreach ($parameters as $parameter) {
    Severity: Minor
    Found in lib/DInjector.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function processQueryResult has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        private function processQueryResult(string $query, $result = null)
        {
            $this->shortcutUsed = false;
    
            if (!empty($result))
    Severity: Minor
    Found in lib/Database/ez_mysqli.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function where has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public function where(...$conditions)
        {
    
            if (empty($conditions))
                return false;
    Severity: Minor
    Found in lib/ezQuery.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function dbSelect has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function dbSelect($name = '', $charset = '')
        {
            $name = empty($name) ? $this->database->getName() : $name;
            try {
                // Try to connect to the database
    Severity: Minor
    Found in lib/Database/ez_mysqli.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 column has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function column(string $column = null, string $type = null, ...$args)
        {
            $vendor = self::vendor();
            if (empty($column) || empty($type) || empty($vendor))
                return false;
    Severity: Minor
    Found in lib/ezSchema.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 create has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function create(string $table = null, ...$schemas)
        {
            $vendor = get_vendor();
            if (empty($table) || empty($schemas) || empty($vendor))
                return false;
    Severity: Minor
    Found in lib/ezQuery.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 query has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function query(string $query, bool $use_prepare = false)
        {
            $param = [];
            if ($use_prepare) {
                $param = &$this->prepareValues();
    Severity: Minor
    Found in lib/Database/ez_sqlsrv.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 connect has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function connect(
            $dsn = '',
            $user = '',
            $password = '',
            $options = array(),
    Severity: Minor
    Found in lib/Database/ez_pdo.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 get_results has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_results(string $query = null, $output = \OBJECT, bool $use_prepare = false)
        {
            // Log how the function was called
            $this->log_query("\$db->get_results(\"$query\", $output, $use_prepare)");
    
    
    Severity: Minor
    Found in lib/ezsqlModel.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

    Severity
    Category
    Status
    Source
    Language