javascript - How to integrate sonar for a Node JS project? - Stack Overflow

I have integrated sonarqube to my Node JS project which am working and it seems to be working fine with

I have integrated sonarqube to my Node JS project which am working and it seems to be working fine with the javascript plugin. I would like to know if there is any way we can specifically mention sonarqube to check the javascript as Node JS?

The configurations to run sonar is specified in the gruntfile.js as below,

sonarRunner: {
    analysis: {
        options: {
            debug: true,
            separator: '\n',
            dryRun: false,
            sonar: {
                host: {
                    url: 'http://localhost:9000'
                },
                jdbc: {
                    url: 'jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance',
                    username: 'root',
                    password: 'root'
                },

                projectKey: 'sonar:grunt-sonar-runner:0.1.0',
                projectName: 'Grunt Sonar Runner',
                projectVersion: '0.10',
                sources: '/app/scripts/controllers',
                language:'js',
                sourceEncoding: 'UTF-8'
            }
        }
    }
}

I have integrated sonarqube to my Node JS project which am working and it seems to be working fine with the javascript plugin. I would like to know if there is any way we can specifically mention sonarqube to check the javascript as Node JS?

The configurations to run sonar is specified in the gruntfile.js as below,

sonarRunner: {
    analysis: {
        options: {
            debug: true,
            separator: '\n',
            dryRun: false,
            sonar: {
                host: {
                    url: 'http://localhost:9000'
                },
                jdbc: {
                    url: 'jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance',
                    username: 'root',
                    password: 'root'
                },

                projectKey: 'sonar:grunt-sonar-runner:0.1.0',
                projectName: 'Grunt Sonar Runner',
                projectVersion: '0.10',
                sources: '/app/scripts/controllers',
                language:'js',
                sourceEncoding: 'UTF-8'
            }
        }
    }
}
Share Improve this question asked Aug 13, 2015 at 5:53 Irfan FuardIrfan Fuard 411 gold badge1 silver badge2 bronze badges 1
  • what do you mean by "to check the javascript as Node JS"? – Stas Vilchik Commented Aug 14, 2015 at 7:46
Add a ment  | 

1 Answer 1

Reset to default 1

The only library/framework-specific parameter available for JavaScript analysis is related to jQuery, so there's no need to make this distinction in your analysis.

However, if there were library-specific settings related to Node.js, you would have two options:

  • simply add the setting in your parameters block. E.G. sonar.javascript.jQueryObjectAliases: foo
  • make the setting change via the project administration GUI (which is the preferred method)

If there are specific rule parameters that should be altered for Node.js projects, then you should acplish that by creating a Node.js-specific rule profile with those parameter settings and assigning your project to it.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745243065a4618285.html

相关推荐

  • javascript - How to integrate sonar for a Node JS project? - Stack Overflow

    I have integrated sonarqube to my Node JS project which am working and it seems to be working fine with

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信