Issues (117)

lib/adapters/changelog.js (3 issues)

1
2 1
var fs          = require('fs');
3 1
var glob        = require('glob');
4 1
var globAll     = require('glob-all');
5 1
var path        = require('path');
6 1
var extend      = require('util')._extend;
7 1
var format      = require('string-template');
8 1
var frontMatter = require('front-matter');
9
10 1
module.exports = function(value, config, cb, pl) {
11 2
    var data = getChangeLog (value, config, pl);
12 2
    cb(null, processTree(data));
13
}
14
15 1
module.exports.config = {
16
    verbose: false
17
}
18
19 1
module.exports.search = function(items, link) {
0 ignored issues
show
The parameter items is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
The parameter link is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
20 1
    var results = [];
21
    // this => collider
22
    /* results.push({
23
        name: name,
24
        type: 'sass ' + type,
25
        description: description,
26
        link: link + hash
27
    }); */
28
29 1
    return results;
30
}
31
32
33
function getChangeLog(value, config, pl) {
34 2
    if (!fs.existsSync(value)) return false;
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
35 1
    var changelogFile = frontMatter(fs.readFileSync(value).toString());
36 1
    var srcTemplate = ''+changelogFile.body+'';
37 1
    var result = pl.markdown.render(srcTemplate); 
38 1
    return result;
39
}
40
41
42
function processTree(tree) {
43
    
44
    // ... my tree assignment stuff
45
46 2
    return tree; //my_stuff;
47
}
48
49