view/js/2/residentes.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 20
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 4
mnd 1
bc 1
fnc 3
bpm 0.3333
cpm 1.3333
noi 3
1
/*
2
 * Copyright (C) 2016 Joe Nilson <joenilson at gmail.com>
3
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
function cargarTipoEdificaciones(){
18
    var listado = '';
19
    $.ajax({
20
        type: 'GET',
21
        url : url_tipo_edificaciones,
0 ignored issues
show
Bug introduced by
The variable url_tipo_edificaciones seems to be never declared. If this is a global, consider adding a /** global: url_tipo_edificaciones */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22
        data : 'busqueda=arbol_tipo_edificaciones',
23
        async: false,
24
        success : function(response) {
25
            if(response.length !== 0){
26
                listado = response;
27
            }else{
28
               alert('¡No hay una estructura asignada para este padre!');
0 ignored issues
show
Debugging Code Best Practice introduced by
The alert UI element is often considered obtrusive and is generally only used as a temporary measure. Consider replacing it with another UI element.
Loading history...
29
            }
30
        },
31
        error: function(response) {
32
            alert(response);
0 ignored issues
show
Debugging Code Best Practice introduced by
The alert UI element is often considered obtrusive and is generally only used as a temporary measure. Consider replacing it with another UI element.
Loading history...
33
        }
34
    });
35
    return listado;
36
}
37