New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

verifyjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verifyjs - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

25

lib/jshint.js

@@ -10,6 +10,7 @@ var jshint = require('jshint'),

var results = hint.data(),
var results = hint.data(),
functionDetails = {},
byLine = {}; // function name lookup by line
// build hash of functions by name

@@ -27,3 +28,6 @@ _.each(results.functions, function(func) {

results.complexityErrors = [];
// results.complexityErrors = [];
results.maxComplexity = 0;
results.maxNesting = 0;
results.totalComplexity = 0;

@@ -43,9 +47,20 @@ _.each(results.errors, function(err) {

var complexity = err.reason.match(/(\()(\d*)(\))/)[2];
_.each(functionDetails[funcName], function(f) {
if (inFunction(err, f)) f.complexity = complexity;
});
results.complexityErrors.push(err);
if (complexity > results.maxComplexity) results.maxComplexity = complexity;
results.totalComplexity += parseInt(complexity, 10);
// results.complexityErrors.push(err);
}
}
// if nesting error, add complexity to initial function object
else if (isNestingError(err)) {
// pull complexity from string with regex
var nesting = err.reason.match(/(\()(\d*)(\))/)[2];
if (nesting > results.maxNesting) results.maxNesting = nesting;
}
// test other errors to find ones that are in functions

@@ -80,2 +95,6 @@ else {

function isNestingError(err) {
return err.raw.indexOf("Blocks are nested") > -1;
}
function funcName(func) {

@@ -82,0 +101,0 @@ return func.name.replace(/'/g, '').replace(/"/g, '');

2

package.json
{
"name": "verifyjs",
"version": "0.0.3",
"version": "0.0.4",
"directories": {},

@@ -5,0 +5,0 @@ "engines": {

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