routes/projects.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 17
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 0
c 2
b 0
f 1
nc 1
dl 0
loc 17
rs 10
wmc 3
mnd 1
bc 4
fnc 2
bpm 2
cpm 1.5
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A projects.js ➔ showAllProjects 0 11 1
1
var database = require('./database');
2
var tableName = 'projects';
3
4
5
function showAllProjects(req, res) {
6
    console.log("Getting project data");
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
7
    database.getProjects(tableName, function(err, result) {
8
        if(err) {
9
            console.log("Error: " + err);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
10
        }
11
        else {
12
            res.json({Projects:result});
13
        }
14
    });
15
}
16
17
exports.showAllProjects = showAllProjects;
18