Showing 61 of 65 total issues
Form
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class Form
{
/**
* Utilizado para generar los id de los radio button,
* lleva un conteo interno.
Upload
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Upload {
/**
* Nombre de archivo subido por método POST
*
Method create
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function create(object $model, string $action = ''): void
{
$model_name = $model::class;
if (!$action) {
$action = ltrim(Router::get('route'), '/');
Date
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Date {
/**
* Valor interno de fecha
*
Function create
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function create(object $model, string $action = ''): void
{
$model_name = $model::class;
if (!$action) {
$action = ltrim(Router::get('route'), '/');
- Read upRead up
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($params, $controller)
{
// nombre de archivo
$file = APP_PATH . 'controllers';
- Read upRead up
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 _validates
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function _validates()
{
// Verifica que se pueda escribir en el directorio
if (!is_writable($this->_path)) {
Flash::error('Error: no se puede escribir en el directorio');
- Read upRead up
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 rmdir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function rmdir($dir)
{
// Obtengo los archivos en el directorio a eliminar
if ($files = array_merge(glob("$dir/*"), glob("$dir/.*"))) {
// Elimino cada subdirectorio o archivo
- Read upRead up
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 dispatch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function dispatch($argv)
{
// Elimino el nombre de archivo del array de argumentos
array_shift($argv);
Method _validates
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _validates()
{
// Verifica que se pueda escribir en el directorio
if (!is_writable($this->_path)) {
Flash::error('Error: no se puede escribir en el directorio');
Method kumbia_autoload
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function kumbia_autoload($class)
{
// Optimizando carga
static $classes;
$classes ??= [
Method create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($params, $controller)
{
// nombre de archivo
$file = APP_PATH . 'controllers';
Function exec
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function exec(){
/*Recorrido por todos los campos*/
foreach ($this->rules as $field => $fRule){
$value = self::getValue($this->obj, $field);
/*Regla individual para cada campo*/
- Read upRead up
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 bindDatePicker
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindDatePicker: function () {
// Selecciona los campos input
let inputs = $("input.js-datepicker");
/**
* Funcion encargada de enlazar el DatePicker a los Input
Function autoload
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
autoload: function () {
let elem = $("[class*='jp-']");
$.each(elem, function (i) {
let el = $(this); //apunta al elemento con clase jp-*
let classes = el.attr("class").split(" ");
Function active_session
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function active_session()
{
$user_hash = md5(serialize($this->extra_args));
$filename = APP_PATH.'temp/cache/'.base64_encode('auth');
if (is_file($filename)) {
- Read upRead up
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 dispatch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected static function dispatch($cont)
{
// Se ejecutan los filtros initialize y before
if ($cont->k_callback(true) === false) {
return $cont;
- Read upRead up
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 createTagDataProvider
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createTagDataProvider()
{
return array(
array(
'a',
Method dbSelect
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function dbSelect($field, $show, $data, $update, $action, $blank=null, $class = '', $attrs = '')
Function get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function get($s, $filter, $options = array()) {
if (is_string($options)) {
$filters = func_get_args();
unset($filters[0]);
- Read upRead up
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"