GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d0e8f5...07c97c )
by Calima
04:13
created

dataControlador::index()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 20
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
rs 9.2
cc 4
eloc 11
nc 4
nop 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 39 and the first side effect is on line 30.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
/*
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the MIT license. For more information, see
18
 * @category   
19
 * @package    sistema/nucleo
20
 * @copyright  Copyright (c) 2006 - 2014 webcol.net (http://www.webcol.net/calima)
21
 * @license	https://github.com/webcol/Calima/blob/master/LICENSE	MIT
22
 * @version	##BETA 1.0##, ##2014 - 2015##
23
 * <http://www.calimaframework.com>.
24
 */
25
26
27
//verificamos la version de php en tu servidor web o local
28
if (version_compare(PHP_VERSION, '5.3.20', '<'))
29
{
30
	die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION);
31
}
32
33
//Cargamos los Espacios de nombres para el nucleo y los ayudantes
34
//Utilizamos un alias
35
use Sistema\Nucleo as Sisnuc;
36
use Sistema\Ayudantes as Sisayu;
37
38
39
class dataControlador extends Sisnuc\CFControlador
40
{
41
    private $_exc;
0 ignored issues
show
Unused Code introduced by
The property $_exc is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
42
    private $_ayuda;
43
    private $_seg;
44
    private $_sesion;
45
    
46 View Code Duplication
    public function __construct() {
47
        parent::__construct();
48
       
49
        $this->_ayuda= new Sisayu\CFPHPAyuda;
50
        //$this->cargaAyudante('CfPHPAyuda');
51
		//$this->cargaAyudante('CfPHPSeguridad');
52
        $this->_seg= new Sisayu\CfPHPSeguridad;
53
        
54
        $this->_sesion=new Sisnuc\CFSesion();
55
         
56
    }
57
    
58
    public function index()
0 ignored issues
show
Coding Style introduced by
index uses the super-global variable $_SESSION which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
59
    { 
60
        // Se verifica que en el archivo de configuracion.php la constante Cf_CONFIG_INICIO==true
61
        //Si esta en True se lanza el instalador de Cf
62
        if(Cf_CONFIG_INICIO==true){
0 ignored issues
show
Bug Best Practice introduced by
It seems like you are loosely comparing Cf_CONFIG_INICIO of type string to the boolean true. If you are specifically checking for a non-empty string, consider using the more explicit !== '' instead.
Loading history...
63
            $this->_sesion->iniciarSesion('_s', false);
64
            if($_SESSION['nivel']==1){
65
            $this->_vista->titulo = 'CalimaFramework';
0 ignored issues
show
Bug introduced by
The property titulo does not seem to exist in Sistema\Nucleo\CFVista.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
66
            $this->_vista->imprimirVista('index', 'data');
0 ignored issues
show
Documentation introduced by
'data' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
67
            }else{
68
                $this->_ayuda->redireccionUrl('usuario');
69
            }
70
            
71
        }elseif (Cf_CONFIG_INICIO=='false') {
72
            
73
            $this->_vista->titulo = 'CalimaFramework';
74
            $this->_vista->imprimirVista('index', 'data');
0 ignored issues
show
Documentation introduced by
'data' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
75
            
76
        }
77
    } 
78
}