snyk-nuget-plugin
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -8,2 +8,3 @@ var fs = require('fs'); | ||
var parseNuspec = require('./nuspec-parser'); | ||
var debug = require('debug')('snyk'); | ||
@@ -69,2 +70,3 @@ function determineManifestType (filename) { | ||
case 'project.json': { | ||
debug('Trying to parse project.json manifest'); | ||
var rawDependencies = JSON.parse(fileContent).dependencies; | ||
@@ -85,2 +87,3 @@ if (rawDependencies) { | ||
case 'packages.config': { | ||
debug('Trying to parse packages.config manifest'); | ||
parseXML(fileContent, function scanPackagesConfig(err, result) { | ||
@@ -105,2 +108,3 @@ if (err) { | ||
case '.csproj': { | ||
debug('Trying to parse .csproj manifest'); | ||
parseXML(fileContent, function scanCsprojContent(err, result) { | ||
@@ -113,7 +117,13 @@ if (err) { | ||
if (referenceItem.HintPath) { | ||
var installedDependency = | ||
Dependecy.from.csprojEntry(referenceItem); | ||
if (installedDependency.name.indexOf('System.') !== 0) { | ||
installedPackages.push(installedDependency); | ||
try { | ||
var installedDependency = | ||
Dependecy.from.csprojEntry(referenceItem); | ||
if (installedDependency.name.indexOf('System.') !== 0) { | ||
installedPackages.push(installedDependency); | ||
} | ||
} | ||
catch (err) { | ||
debug('Could not parse package name. Skipping'); | ||
// gracefully continue | ||
} | ||
} | ||
@@ -129,2 +139,3 @@ }); | ||
}).then(function scanInstalled(installedPackages) { | ||
debug('Located ' + installedPackages.length + ' packages in manifest'); | ||
function injectPath(dep) { | ||
@@ -139,4 +150,6 @@ dep.path = path.resolve( | ||
flattendPackageList[entry.name] = entry; | ||
debug('Entry: ' + entry.name + ' -> ' + entry.path); | ||
}); | ||
try { | ||
debug('Trying to read installed packaged folder: ' + packagesFolder); | ||
fs.readdirSync(packagesFolder) | ||
@@ -154,2 +167,4 @@ .filter(function (name) { | ||
} catch (error) { | ||
debug('Could not complete installed packages folder scanning'); | ||
debug(error); | ||
// could not read installed packages folder, | ||
@@ -165,5 +180,7 @@ // continue only with manifest list | ||
// initiate collecting information from .nuget files on installed packages | ||
debug('Trying to analyze .nuspec files'); | ||
var nuspecParserChain = []; | ||
for (var name in flattendPackageList) { | ||
var dep = flattendPackageList[name]; | ||
debug('...' + name); | ||
nuspecParserChain.push(parseNuspec(dep)); | ||
@@ -175,2 +192,3 @@ } | ||
if (!resolution) return; // jscs:ignore | ||
debug('.nuspec analyzed for ' + resolution.name); | ||
nuspecResolutions[resolution.name] = resolution; | ||
@@ -181,2 +199,3 @@ }); | ||
// now the flat list should be rebuilt as a tree | ||
debug('Building dependency tree'); | ||
function buildTree(node, requiredChildren, repository) { | ||
@@ -183,0 +202,0 @@ var resolutionName = node.name + '@' + node.version; |
@@ -1,1 +0,1 @@ | ||
{"name":"snyk-nuget-plugin","description":"![logo](https://res.cloudinary.com/snyk/image/upload/v1468845259/logo/snyk-dog.svg) ## Snyk: NuGet Plugin ***","main":"lib/index.js","scripts":{"lint":"jscs `find ./lib -name '*.js'` -v && jscs `find ./test -name '*.js'` -v","test":"npm run unit-test","unit-test":"tap `ls ./test/*.test.js` -R=spec","dev":"nodemon -x 'npm run unit-test'","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"https://github.com/snyk/snyk-nuget-plugin.git"},"keywords":["snyk","nuget"],"author":"snyk.io","license":"Apache-2.0","bugs":{"url":"https://github.com/snyk/snyk-nuget-plugin/issues"},"homepage":"https://github.com/snyk/snyk-nuget-plugin#readme","dependencies":{"es6-promise":"^4.1.1","xml2js":"^0.4.17","zip":"^1.2.0"},"devDependencies":{"jscs":"^3.0.7","nodemon":"^1.12.1","semantic-release":"^8.2.0","tap":"^10.7.0","tap-only":"0.0.5"},"version":"1.3.0"} | ||
{"name":"snyk-nuget-plugin","description":"![logo](https://res.cloudinary.com/snyk/image/upload/v1468845259/logo/snyk-dog.svg) ## Snyk: NuGet Plugin ***","main":"lib/index.js","scripts":{"lint":"jscs `find ./lib -name '*.js'` -v && jscs `find ./test -name '*.js'` -v","test":"npm run unit-test","test-windows":"tap -R spec test/*.test.js --timeout=120","unit-test":"tap `ls ./test/*.test.js` -R=spec","dev":"nodemon -x 'npm run unit-test'","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"https://github.com/snyk/snyk-nuget-plugin.git"},"keywords":["snyk","nuget"],"author":"snyk.io","license":"Apache-2.0","bugs":{"url":"https://github.com/snyk/snyk-nuget-plugin/issues"},"homepage":"https://github.com/snyk/snyk-nuget-plugin#readme","dependencies":{"debug":"^3.1.0","es6-promise":"^4.1.1","xml2js":"^0.4.17","zip":"^1.2.0"},"devDependencies":{"jscs":"^3.0.7","nodemon":"^1.12.1","semantic-release":"^8.2.0","tap":"^10.7.0","tap-only":"0.0.5"},"version":"1.3.1"} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15675
375
4
+ Addeddebug@^3.1.0
+ Addeddebug@3.2.7(transitive)
+ Addedms@2.1.3(transitive)