• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dondi / GRNsight / 17425127190

03 Sep 2025 06:33AM UTC coverage: 80.379%. Remained the same
17425127190

Pull #1198

github

dondi
Address post-merge linting errors.
Pull Request #1198: Prettier Configuration

410 of 513 branches covered (79.92%)

Branch coverage included in aggregate %.

266 of 335 new or added lines in 18 files covered. (79.4%)

7 existing lines in 4 files now uncovered.

1200 of 1490 relevant lines covered (80.54%)

9339.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/server/controllers/import-controller.js
1
var helpers = require(__dirname + "/helpers");
3✔
2

3
var sifToGrnsight = require(__dirname + "/importers/sif");
3✔
4
var graphMlToGrnsight = require(__dirname + "/importers/graphml");
3✔
5

6
module.exports = function (app) {
3✔
7
    if (app) {
6!
8
        var multiparty = require("multiparty");
×
9
        var path = require("path");
×
10
        var fs = require("fs");
×
11

12
        var performUpload = function (req, res, extension, importer) {
×
13
            helpers.attachCorsHeader(res, app);
×
14

NEW
15
            new multiparty.Form().parse(req, function (error, fields, files) {
×
16
                if (error) {
×
NEW
17
                    return res.send(
×
18
                        400,
19
                        "There was a problem uploading your file. Please try again."
20
                    );
21
                }
22

23
                var input;
24
                try {
×
25
                    input = files.file[0].path;
×
26
                } catch (error) {
27
                    return res.send(400, "No import file selected.");
×
28
                }
29

30
                if (path.extname(input) !== "." + extension) {
×
31
                    return res.send(400, "The filename does not end in ." + extension + ".");
×
32
                }
33

34
                fs.readFile(input, { encoding: "utf-8" }, function (error, data) {
×
35
                    if (error) {
×
36
                        throw error;
×
37
                    } else {
38
                        helpers.attachFileHeaders(res, input);
×
39
                        var workbook = importer(data);
×
NEW
40
                        return res.status(workbook.errors.length === 0 ? 200 : 400).json(workbook);
×
41
                    }
42
                });
43
            });
44
        };
45

46
        app.post("/upload-sif", function (req, res) {
×
47
            performUpload(req, res, "sif", sifToGrnsight);
×
48
        });
49

50
        app.post("/upload-graphml", function (req, res) {
×
51
            performUpload(req, res, "graphml", graphMlToGrnsight);
×
52
        });
53
    }
54

55
    return {
6✔
56
        sifToGrnsight: sifToGrnsight,
57
        graphMlToGrnsight: graphMlToGrnsight,
58
    };
59
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc