KumbiaPHP/KumbiaPHP

View on GitHub

Showing 65 of 65 total issues

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

    public static function rewrite(string $url): array
    {
        $router = [];
        //Valor por defecto
        if ($url === '/') {
Severity: Minor
Found in core/kumbia/kumbia_router.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

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

    public static function models($model)
    {
        $args = is_array($model) ? $model : func_get_args();
        foreach ($args as $model) {
            $Model = Util::camelcase(basename($model));
Severity: Minor
Found in core/kumbia/load.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

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

    public static function createSecureRSAKey($kumbia = true)
    {
        $config = Config::read('config');
        if ($config->kumbia->secure_ajax) {
            if ($_SESSION['rsa_key']) {
Severity: Minor
Found in core/libs/security/security.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

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

    public function identify($login = '', $pass = '', $mode = '') {
        if ($this->isValid()) {
            return TRUE;
        } else {
            // check
Severity: Minor
Found in core/libs/auth2/auth2.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

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

    protected function _toBytes($size) {
        if (is_int($size) || ctype_digit($size)) {
            return (int) $size;
        }

Severity: Minor
Found in core/libs/upload/upload.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

Severity
Category
Status
Source
Language