Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sfdx-codescan-plugin

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sfdx-codescan-plugin - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

14

lib/commands/codescan/run.d.ts

@@ -9,10 +9,10 @@ import { flags, SfdxCommand } from '@salesforce/command';

protected static flagsConfig: {
server: flags.Discriminated<flags.Option<string>>;
organization: flags.Discriminated<flags.Option<string>>;
projectkey: flags.Discriminated<flags.Option<string>>;
token: flags.Discriminated<flags.Option<string>>;
username: flags.Discriminated<flags.Option<string>>;
password: flags.Discriminated<flags.Option<string>>;
server: flags.Discriminated<flags.String>;
organization: flags.Discriminated<flags.String>;
projectkey: flags.Discriminated<flags.String>;
token: flags.Discriminated<flags.String>;
username: flags.Discriminated<flags.String>;
password: flags.Discriminated<flags.String>;
noqualitygate: flags.Discriminated<flags.Boolean<boolean>>;
javahome: flags.Discriminated<flags.Option<string>>;
javahome: flags.Discriminated<flags.String>;
nofail: flags.Discriminated<flags.Boolean<boolean>>;

@@ -19,0 +19,0 @@ qgtimeout: flags.Discriminated<flags.Number>;

@@ -14,3 +14,20 @@ "use strict";

// or any library that is using the messages framework can also be loaded this way.
const messages = core_1.Messages.loadMessages('sfdx-codescan-plugin', 'codescan');
const messages = core_1.Messages.load('sfdx-codescan-plugin', 'codescan', [
'runCommandDescription',
'serverFlagDescription',
'organizationFlagDescription',
'projectKeyFlagDescription',
'tokenFlagDescription',
'usernameFlagDescription',
'passwordFlagDescription',
'noqualitygateFlagDescription',
'javahomeFlagDescription',
'nofailFlagDescription',
'qgtimeoutFlagDescription',
'errorTokenAndUserPass',
'errorOnlyUserOrPass',
'errorNoOrganization',
'errorInvalidServerUrl',
'errorDuplicateValues',
]);
class Run extends command_1.SfdxCommand {

@@ -33,6 +50,6 @@ constructor() {

else if (!this.flags.server.match(/https?:\/\/[A-Za-z0-9\-_]+(\..+|:[0-9]+\/*.*|\/.*)/)) {
throw new core_1.SfdxError(messages.getMessage('errorInvalidServerUrl'));
throw new core_1.SfError(messages.getMessage('errorInvalidServerUrl'));
}
if (this.flags.server && this.flags.server.endsWith('codescan.io') && !this.flags.organization) {
throw new core_1.SfdxError(messages.getMessage('errorNoOrganization'));
throw new core_1.SfError(messages.getMessage('errorNoOrganization'));
}

@@ -51,3 +68,3 @@ // put -J vm args at front...

if (this.contains(varargs, '-Dsonar.host.url')) {
throw new core_1.SfdxError(messages.getMessage('errorDuplicateValues', ['server']));
throw new core_1.SfError(messages.getMessage('errorDuplicateValues', ['server']));
}

@@ -58,3 +75,3 @@ args.push('-Dsonar.host.url=' + this.flags.server);

if (this.contains(varargs, '-Dsonar.organization')) {
throw new core_1.SfdxError(messages.getMessage('errorDuplicateValues', ['organization']));
throw new core_1.SfError(messages.getMessage('errorDuplicateValues', ['organization']));
}

@@ -66,3 +83,3 @@ args.push('-Dsonar.organization=' + this.flags.organization);

if (this.flags.token || this.flags.username && this.flags.password) {
throw new core_1.SfdxError(messages.getMessage('errorDuplicateValues', ['token/username/password']));
throw new core_1.SfError(messages.getMessage('errorDuplicateValues', ['token/username/password']));
}

@@ -72,3 +89,3 @@ }

if (this.flags.username || this.flags.password) {
throw new core_1.SfdxError(messages.getMessage('errorTokenAndUserPass'));
throw new core_1.SfError(messages.getMessage('errorTokenAndUserPass'));
}

@@ -82,3 +99,3 @@ args.push('-Dsonar.login=' + this.flags.token);

else if (this.flags.username || this.flags.password) {
throw new core_1.SfdxError(messages.getMessage('errorOnlyUserOrPass'));
throw new core_1.SfError(messages.getMessage('errorOnlyUserOrPass'));
}

@@ -90,3 +107,3 @@ else {

if (this.contains(varargs, '-Dsonar.projectKey')) {
throw new core_1.SfdxError(messages.getMessage('errorDuplicateValues', ['projectkey']));
throw new core_1.SfError(messages.getMessage('errorDuplicateValues', ['projectkey']));
}

@@ -112,3 +129,3 @@ args.push('-Dsonar.projectKey=' + this.flags.projectkey);

this.ux.log(`\nRunning command \n[${command}] \nwith arguments \n${args.join('\n')}\n`);
const cmd = child_process_1.spawn(command, args);
const cmd = (0, child_process_1.spawn)(command, args);
cmd.stdout.pipe(process.stdout);

@@ -175,7 +192,7 @@ cmd.stderr.pipe(process.stderr);

return new Promise((resolve, reject) => {
qualitygate_1.pollQualityGate(auth, end, sonarWorkingDir, 2000, resolve, reject);
(0, qualitygate_1.pollQualityGate)(auth, end, sonarWorkingDir, 2000, resolve, reject);
});
}
resolveJava(javaHome) {
return requirements_1.resolveRequirements(javaHome)
return (0, requirements_1.resolveRequirements)(javaHome)
.catch(error => {

@@ -182,0 +199,0 @@ throw error;

@@ -1,1 +0,1 @@

{"version":"1.0.7","commands":{"codescan:run":{"id":"codescan:run","description":"Runs a SonarQube analysis.","usage":"<%= command.id %> [name=value...] [-s <string>] [-o <string>] [-k <string>] [-t <string>] [-u <string>] [-p <string>] [--noqualitygate] [--javahome <string>] [--nofail] [--qgtimeout <integer>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-codescan-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx codescan:run --token <token> --projectkey my-project-key --organization my-org-key\n ","$ sfdx codescan:run --token <token> --projectkey my-project-key --organization my-org-key -Dsonar.verbose=true\n -D can be used for passing any sonar-scanner definition\n -J will be passed as a jvm arg\n ","$ sfdx codescan:run ... -X\n Verbose output"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"server":{"name":"server","type":"option","char":"s","description":" URL of you SonarQube/CodeScan Cloud server. Defaults to CodeScan Cloud (https://app.codescan.io)"},"organization":{"name":"organization","type":"option","char":"o","description":"CodeScan Organization ID. Only required when connecting to CodeScan Cloud."},"projectkey":{"name":"projectkey","type":"option","char":"k","description":"sonar.projectKey - the project key to create."},"token":{"name":"token","type":"option","char":"t","description":"SonarQube token. The preferred method of authentication."},"username":{"name":"username","type":"option","char":"u","description":"SonarQube username (SonarQube token is preferred)"},"password":{"name":"password","type":"option","char":"p","description":"SonarQube password (SonarQube token is preferred)"},"noqualitygate":{"name":"noqualitygate","type":"boolean","description":"Don't wait until the SonarQube background task is finished and return the build Quality Gate.","allowNo":false},"javahome":{"name":"javahome","type":"option","description":"JAVA_HOME to use."},"nofail":{"name":"nofail","type":"boolean","description":"Don't fail if sonar-scanner fails.","allowNo":false},"qgtimeout":{"name":"qgtimeout","type":"option","description":"Timeout in seconds to wait for Quality Gate to complete (default 300)."}},"args":[]}}}
{"version":"1.0.8","commands":{"codescan:run":{"id":"codescan:run","description":"Runs a SonarQube analysis.","strict":true,"usage":"<%= command.id %> [name=value...] [-s <string>] [-o <string>] [-k <string>] [-t <string>] [-u <string>] [-p <string>] [--noqualitygate] [--javahome <string>] [--nofail] [--qgtimeout <integer>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"sfdx-codescan-plugin","pluginAlias":"sfdx-codescan-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx codescan:run --token <token> --projectkey my-project-key --organization my-org-key\n ","$ sfdx codescan:run --token <token> --projectkey my-project-key --organization my-org-key -Dsonar.verbose=true\n -D can be used for passing any sonar-scanner definition\n -J will be passed as a jvm arg\n ","$ sfdx codescan:run ... -X\n Verbose output"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"server":{"name":"server","type":"option","char":"s","description":" URL of you SonarQube/CodeScan Cloud server. Defaults to CodeScan Cloud (https://app.codescan.io)","multiple":false},"organization":{"name":"organization","type":"option","char":"o","description":"CodeScan Organization ID. Only required when connecting to CodeScan Cloud.","multiple":false},"projectkey":{"name":"projectkey","type":"option","char":"k","description":"sonar.projectKey - the project key to create.","multiple":false},"token":{"name":"token","type":"option","char":"t","description":"SonarQube token. The preferred method of authentication.","multiple":false},"username":{"name":"username","type":"option","char":"u","description":"SonarQube username (SonarQube token is preferred)","multiple":false},"password":{"name":"password","type":"option","char":"p","description":"SonarQube password (SonarQube token is preferred)","multiple":false},"noqualitygate":{"name":"noqualitygate","type":"boolean","description":"Don't wait until the SonarQube background task is finished and return the build Quality Gate.","allowNo":false},"javahome":{"name":"javahome","type":"option","description":"JAVA_HOME to use.","multiple":false},"nofail":{"name":"nofail","type":"boolean","description":"Don't fail if sonar-scanner fails.","allowNo":false},"qgtimeout":{"name":"qgtimeout","type":"option","description":"Timeout in seconds to wait for Quality Gate to complete (default 300).","multiple":false}},"args":[],"varargs":true,"flagsConfig":{"server":{"kind":"string","char":"s","description":" URL of you SonarQube/CodeScan Cloud server. Defaults to CodeScan Cloud (https://app.codescan.io)","input":[],"multiple":false,"type":"option"},"organization":{"kind":"string","char":"o","description":"CodeScan Organization ID. Only required when connecting to CodeScan Cloud.","input":[],"multiple":false,"type":"option"},"projectkey":{"kind":"string","char":"k","description":"sonar.projectKey - the project key to create.","input":[],"multiple":false,"type":"option"},"token":{"kind":"string","char":"t","description":"SonarQube token. The preferred method of authentication.","input":[],"multiple":false,"type":"option"},"username":{"kind":"string","char":"u","description":"SonarQube username (SonarQube token is preferred)","input":[],"multiple":false,"type":"option"},"password":{"kind":"string","char":"p","description":"SonarQube password (SonarQube token is preferred)","input":[],"multiple":false,"type":"option"},"noqualitygate":{"kind":"boolean","description":"Don't wait until the SonarQube background task is finished and return the build Quality Gate.","allowNo":false,"type":"boolean"},"javahome":{"kind":"string","description":"JAVA_HOME to use.","input":[],"multiple":false,"type":"option"},"nofail":{"kind":"boolean","description":"Don't fail if sonar-scanner fails.","allowNo":false,"type":"boolean"},"qgtimeout":{"kind":"integer","description":"Timeout in seconds to wait for Quality Gate to complete (default 300).","input":[],"multiple":false,"type":"option"}},"SONAR_SCANNER_VERSION":"3.3.0.1492"}}}
{
"name": "sfdx-codescan-plugin",
"description": "Run CodeScan or SonarQube jobs from sfdx",
"version": "1.0.7",
"author": "Ben van Klinken @ustramooner",
"bugs": "https://github.com/VillageChief/sfdx-codescan-plugin/issues",
"version": "1.0.8",
"author": "Ben van Klinken @ustramooner, Barys Yakavita @borisbsu",
"bugs": "https://github.com/codescan-io/sfdx-codescan-plugin/issues",
"dependencies": {

@@ -11,28 +11,40 @@ "@oclif/command": "^1",

"@oclif/errors": "^1",
"@salesforce/command": "^2",
"@salesforce/core": "^2",
"@salesforce/command": "^5",
"@salesforce/core": "^3",
"copy-dir": "^1.3.0",
"expand-home-dir": "0.0.3",
"find-java-home": "^0.2.0",
"node-unzip-2": "^0.2.8",
"copy-dir": "^1.3.0",
"tslib": "^1"
"request": "^2.88.2",
"tslib": "^2"
},
"devDependencies": {
"@oclif/dev-cli": "^1",
"@oclif/plugin-help": "^2",
"@oclif/test": "^1",
"@salesforce/dev-config": "1.4.1",
"@oclif/test": "^2",
"@salesforce/ts-sinon": "^1",
"@types/chai": "^4",
"@types/mocha": "^5",
"@types/node": "^10",
"@types/mocha": "^8",
"@types/node": "^14",
"@typescript-eslint/eslint-plugin": "^4",
"@typescript-eslint/parser": "^4",
"chai": "^4",
"eslint": "^7",
"eslint-config-prettier": "^8",
"eslint-plugin-header": "^3",
"eslint-plugin-import": "^2",
"eslint-plugin-jsdoc": "^35",
"eslint-plugin-prettier": "^3",
"eslint-plugin-typescript": "^0",
"globby": "^8",
"mocha": "^5",
"nyc": "^13",
"ts-node": "^8.10.2",
"tslint": "^5",
"typescript": "^3.9.3"
"mocha": "^9",
"nyc": "^15",
"oclif": "^3",
"prettier": "^2",
"rimraf": "latest",
"sinon": "10.0.0",
"ts-node": "^10",
"typescript": "^4"
},
"engines": {
"node": ">=8.0.0"
"node": ">=14.0.0"
},

@@ -46,3 +58,3 @@ "files": [

],
"homepage": "https://github.com/VillageChief/sfdx-codescan-plugin",
"homepage": "https://github.com/codescan-io/sfdx-codescan-plugin",
"keywords": [

@@ -66,8 +78,10 @@ "sfdx-plugin"

"scripts": {
"postpack": "rm -f oclif.manifest.json",
"posttest": "tslint -p test -t stylish",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif-dev readme && git add README.md"
"build": "tsc -p .",
"lint": "eslint src/**/*.ts test/**/*.ts",
"postpack": "rimraf oclif.manifest.json",
"posttest": "eslint src/**/*.ts test/**/*.ts",
"prepack": "rimraf lib && tsc -b && oclif manifest && oclif readme",
"test": "nyc --extension .ts --require ts-node/register mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif readme && git add README.md"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc