Socket
Socket
Sign inDemoInstall

snyk-gradle-plugin

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-gradle-plugin - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

6

dist/graph.d.ts
import type { CoordinateMap } from './types';
export interface SnykGraph {
export interface GradleGraph {
[id: string]: {

@@ -13,4 +13,4 @@ name: string;

}
export declare function buildGraph(snykGraph: SnykGraph, rootPkgName: string, projectVersion: string, coordinateMap?: CoordinateMap): Promise<import("@snyk/dep-graph").DepGraph>;
export declare function findChildren(parentId: string, snykGraph: SnykGraph): QueueItem[];
export declare function buildGraph(gradleGraph: GradleGraph, rootPkgName: string, projectVersion: string, coordinateMap?: CoordinateMap): Promise<import("@snyk/dep-graph").DepGraph>;
export declare function findChildren(parentId: string, gradleGraph: GradleGraph): QueueItem[];
export {};

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

const dep_graph_1 = require("@snyk/dep-graph");
async function buildGraph(snykGraph, rootPkgName, projectVersion, coordinateMap) {
async function buildGraph(gradleGraph, rootPkgName, projectVersion, coordinateMap) {
const pkgManager = { name: 'gradle' };
const isEmptyGraph = !snykGraph || Object.keys(snykGraph).length === 0;
const isEmptyGraph = !gradleGraph || Object.keys(gradleGraph).length === 0;
const depGraphBuilder = new dep_graph_1.DepGraphBuilder(pkgManager, {

@@ -18,3 +18,3 @@ name: rootPkgName,

const queue = [];
queue.push(...findChildren('root-node', snykGraph)); // queue direct dependencies
queue.push(...findChildren('root-node', gradleGraph)); // queue direct dependencies
// breadth first search

@@ -26,5 +26,5 @@ while (queue.length > 0) {

let { id, parentId } = item;
// take a copy as id maybe mutated below and we need this id when finding childing in snykGraph
const snykGraphId = `${id}`;
const node = snykGraph[id];
// take a copy as id maybe mutated below and we need this id when finding childing in GradleGraph
const gradleGraphId = `${id}`;
const node = gradleGraph[id];
if (!node)

@@ -54,3 +54,3 @@ continue;

depGraphBuilder.connectDep(parentId, id);
queue.push(...findChildren(snykGraphId, snykGraph)); // queue children
queue.push(...findChildren(gradleGraphId, gradleGraph)); // queue children
visited.push(id);

@@ -61,7 +61,7 @@ }

exports.buildGraph = buildGraph;
function findChildren(parentId, snykGraph) {
function findChildren(parentId, gradleGraph) {
var _a;
const result = [];
for (const id of Object.keys(snykGraph)) {
const node = snykGraph[id];
for (const id of Object.keys(gradleGraph)) {
const node = gradleGraph[id];
if ((_a = node === null || node === void 0 ? void 0 : node.parentIds) === null || _a === void 0 ? void 0 : _a.includes(parentId)) {

@@ -68,0 +68,0 @@ result.push({ id, parentId });

import { DepGraph } from '@snyk/dep-graph';
import { legacyPlugin as api } from '@snyk/cli-interface';
import { getGradleAttributesPretty } from './gradle-attributes-pretty';
import { SnykGraph } from './graph';
import { GradleGraph } from './graph';
import type { CoordinateMap, PomCoords, Sha1Map, SnykHttpClient } from './types';

@@ -31,3 +31,3 @@ export declare function debugLog(s: string): void;

depGraph?: DepGraph;
snykGraph?: SnykGraph;
gradleGraph?: GradleGraph;
targetFile: string;

@@ -34,0 +34,0 @@ projectVersion: string;

@@ -394,4 +394,4 @@ "use strict";

const { defaultProject, defaultProjectKey } = extractedJSON;
const { snykGraph, projectVersion } = extractedJSON.projects[projectId];
if (!snykGraph) {
const { gradleGraph, projectVersion } = extractedJSON.projects[projectId];
if (!gradleGraph) {
continue;

@@ -404,5 +404,5 @@ }

}
extractedJSON.projects[projectId].depGraph = await (0, graph_1.buildGraph)(snykGraph, rootPkgName, projectVersion, coordinateMap);
extractedJSON.projects[projectId].depGraph = await (0, graph_1.buildGraph)(gradleGraph, rootPkgName, projectVersion, coordinateMap);
// this property usage ends here
delete extractedJSON.projects[projectId].snykGraph;
delete extractedJSON.projects[projectId].gradleGraph;
}

@@ -409,0 +409,0 @@ return extractedJSON;

@@ -57,3 +57,3 @@ {

},
"version": "4.0.0"
"version": "4.0.1"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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