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

mythx-report-helper

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mythx-report-helper - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

37

build/src/Report.js

@@ -8,5 +8,6 @@ "use strict";

class Report {
constructor(issues, input) {
constructor(issues, input, filter) {
this.originalIssues = issues;
this.input = input;
this.filter = filter;
this.sourceFilesNames = [];

@@ -22,3 +23,27 @@ this.sortedFileNames = [];

this.issuesWithMetrics = this.originalIssues && metrics_1.processMetrics(this.originalIssues);
this.processedIssues && this.applyFilters();
}
updateFilter(newFilter) {
this.filter = newFilter;
this.processedIssues && this.applyFilters();
this.originalIssues && this.input && this.indexVulnerabilitiesByLineNumber();
}
getIssuesToDisplay() {
return this.filteredIssues ? this.filteredIssues : this.processedIssues;
}
applyFilters() {
let filteredIssues = this.processedIssues;
if (!this.filter) {
return;
}
if (!this.filter.displayIgnored) {
filteredIssues = filteredIssues.filter((issue) => !issue.ignored);
}
if (this.filter.severity) {
filteredIssues = filteredIssues.filter((issue) => {
return this.filter.severity.indexOf(issue.severity.toLowerCase()) > -1;
});
}
this.filteredIssues = filteredIssues;
}
setupSourceFiles() {

@@ -72,3 +97,6 @@ if (this.input.mainSource) {

}
logs = logs && logs.filter(log => log.length !== 0).flat(1);
logs = logs && logs.length && logs.filter(log => log.length !== 0);
if (logs.flat) {
logs = logs.flat(1);
}
this.logs = logs;

@@ -134,3 +162,3 @@ }

indexVulnerabilitiesByLineNumber() {
const { processedIssues, sourceFilesNames, sourceFiles } = this;
const { processedIssues, filteredIssues, sourceFilesNames, sourceFiles } = this;
sourceFilesNames.map((name) => {

@@ -148,3 +176,4 @@ const { source, sourceFileAvailable } = sourceFiles[name];

}
const issuesForFile = processedIssues.filter((issue) => {
const targetIssues = filteredIssues || processedIssues;
const issuesForFile = targetIssues.filter((issue) => {
if (issue.isTypeSolidity && issue.hasDecodedLocation && issue.sourceCode) {

@@ -151,0 +180,0 @@ return issue.sourceCode.name === name;

2

package.json
{
"name": "mythx-report-helper",
"version": "1.1.3",
"version": "1.1.4",
"description": "TS helper to manage mythx reports",

@@ -5,0 +5,0 @@ "main": "./build/src/index.js",

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