KumbiaPHP/KumbiaPHP

View on GitHub

Showing 61 of 65 total issues

Method form has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function form($update, $action = '', $class = '', $method = 'post', $attrs = '')
Severity: Minor
Found in core/extensions/helpers/ajax.php - About 35 mins to fix

    Method linkAction has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function linkAction($action, $text, $confirm = '¿Está Seguro?', $class = '', $attrs = '')
    Severity: Minor
    Found in core/extensions/helpers/js.php - About 35 mins to fix

      Method getField has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function getField($field, $value = null, $is_check = false, $filter = true, $check = false)
      Severity: Minor
      Found in core/extensions/helpers/form.php - About 35 mins to fix

        Method link has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function link($action, $text, $update, $class = '', $attrs = '')
        Severity: Minor
        Found in core/extensions/helpers/ajax.php - About 35 mins to fix

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

              public static function load($console_name)
              {
                  // nombre de la clase de consola
                  $Console = Util::camelcase($console_name) . 'Console';
          
          
          Severity: Minor
          Found in core/kumbia/console.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 authenticate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function authenticate()
              {
          
                  $radius = radius_auth_open();
                  if (!$radius) {
          Severity: Minor
          Found in core/libs/auth/adapters/radius_auth.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($auth, $extra_args)
              {
                  foreach (array('filename') as $param) {
                      if (isset($extra_args[$param])) {
                          $this->$param = $extra_args[$param];
          Severity: Minor
          Found in core/libs/auth/adapters/digest_auth.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 authenticate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function authenticate()
              {
                  $where_condition = array();
                  foreach ($this->compare_attributes as $field => $value) {
                      $value = addslashes($value);
          Severity: Minor
          Found in core/libs/auth/adapters/model_auth.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 parent::_validates();
          Severity: Major
          Found in core/libs/upload/adapters/image_upload.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return FALSE;
            Severity: Major
            Found in core/libs/upload/adapters/image_upload.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return FALSE;
              Severity: Major
              Found in core/libs/upload/adapters/image_upload.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return;
                Severity: Major
                Found in core/kumbia/autoload.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return;
                  Severity: Major
                  Found in core/kumbia/autoload.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $router;
                    Severity: Major
                    Found in core/kumbia/kumbia_router.php - About 30 mins to fix

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

                      function kumbia_autoload($class)
                      {
                          // Optimizando carga
                          static $classes;
                          $classes ??= [
                      Severity: Minor
                      Found in core/kumbia/autoload.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 getFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected static function getFilter(Array $var, $str)
                          {
                              if(empty($str)) {
                                  return filter_var_array($var);
                              }   
                      Severity: Minor
                      Found in core/libs/input/input.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 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

                      Severity
                      Category
                      Status
                      Source
                      Language