Skip to content

Commit d1ee7d9

Browse files
committed
removing all comments
1 parent 7c09277 commit d1ee7d9

File tree

3 files changed

+0
-51
lines changed

3 files changed

+0
-51
lines changed

commands/audit/sca/python/python.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ const (
3434
CurationPipMinimumVersion = "23.0.0"
3535
)
3636

37-
/* TODO eran delete at the end
38-
type AuditPython struct {
39-
Server *config.ServerDetails
40-
Tool pythonutils.PythonTool
41-
RemotePypiRepo string
42-
PipRequirementsFile string
43-
InstallCommandArgs []string
44-
IsCurationCmd bool
45-
}
46-
47-
*/
48-
4937
func BuildDependencyTree(params utils.AuditParams) (dependencyTree []*clientutils.GraphNode, uniqueDeps []string, downloadUrls map[string]string, err error) {
5038
dependenciesGraph, directDependenciesList, pipUrls, errGetTree := getDependencies(params)
5139
if errGetTree != nil {
@@ -103,13 +91,6 @@ func getDependencies(params utils.AuditParams) (dependenciesGraph map[string][]s
10391
return
10492
}
10593

106-
// TODO eran - is it possible to not have the technology here so we need to place pip first? is that even correct doing that?
107-
/*
108-
pythonTool := pythonutils.Pip
109-
if len(params.Technologies()) > 0 {
110-
pythonTool = pythonutils.PythonTool(params.Technologies()[0])
111-
}
112-
*/
11394
pythonTool := pythonutils.PythonTool(params.Technologies()[0])
11495
if !params.SkipAutoInstall() {
11596
var restoreEnv func() error

commands/audit/sca/python/python_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func TestBuildPipDependencyListSetuppy(t *testing.T) {
2727
defer cleanUp()
2828
// Run getModulesDependencyTrees
2929
params := clisecurityutils.AuditBasicParams{}
30-
// params.SetTechnologies([]string{string(techutils.Pip)}) // TODO eran delete
3130
params.AddTechnologyIfNotExist(techutils.Pip.String())
3231
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
3332
assert.NoError(t, err)
@@ -56,7 +55,6 @@ func TestPipDependencyListCustomInstallArgs(t *testing.T) {
5655
assert.NoError(t, os.Chdir(filepath.Join(actualMainPath, "referenceproject")))
5756
// Run getModulesDependencyTrees
5857
params := clisecurityutils.AuditBasicParams{}
59-
//params.SetTechnologies([]string{string(techutils.Pip)}) // TODO eran delete
6058
params.AddTechnologyIfNotExist(techutils.Pip.String())
6159
params.SetInstallCommandArgs([]string{"--force-reinstall"})
6260
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
@@ -69,7 +67,6 @@ func TestBuildPipDependencyListSetuppyForCuration(t *testing.T) {
6967
defer cleanUp()
7068
// Run getModulesDependencyTrees
7169
params := clisecurityutils.AuditBasicParams{}
72-
// params.SetTechnologies([]string{string(techutils.Pip)}) // TODO eran delete
7370
params.AddTechnologyIfNotExist(techutils.Pip.String())
7471
params.SetIsCurationCmd(true)
7572
rootNode, uniqueDeps, downloadUrls, err := BuildDependencyTree(&params)
@@ -103,7 +100,6 @@ func TestPipDependencyListRequirementsFallback(t *testing.T) {
103100
defer cleanUp()
104101
// No requirements file field specified, expect the command to use the fallback 'pip install -r requirements.txt' command
105102
params := clisecurityutils.AuditBasicParams{}
106-
// params.SetTechnologies([]string{string(techutils.Pip)}) // TODO eran delete
107103
params.AddTechnologyIfNotExist(techutils.Pip.String())
108104
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
109105
validatePipRequirementsProject(t, err, uniqueDeps, rootNode)
@@ -129,7 +125,6 @@ func TestBuildPipDependencyListRequirements(t *testing.T) {
129125
defer cleanUp()
130126
// Run getModulesDependencyTrees
131127
params := clisecurityutils.AuditBasicParams{}
132-
// params.SetTechnologies([]string{string(techutils.Pip)}) // TODO eran delete
133128
params.AddTechnologyIfNotExist(techutils.Pip.String())
134129
params.SetPipRequirementsFile("requirements.txt")
135130
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
@@ -159,7 +154,6 @@ func TestBuildPipenvDependencyList(t *testing.T) {
159154
}
160155
// Run getModulesDependencyTrees
161156
params := clisecurityutils.AuditBasicParams{}
162-
// params.SetTechnologies([]string{string(techutils.Pipenv)}) // TODO eran delete
163157
params.AddTechnologyIfNotExist(techutils.Pipenv.String())
164158
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
165159
if err != nil {
@@ -197,7 +191,6 @@ func TestBuildPoetryDependencyList(t *testing.T) {
197191
}
198192
// Run getModulesDependencyTrees
199193
params := clisecurityutils.AuditBasicParams{}
200-
// params.SetTechnologies([]string{string(techutils.Poetry)}) // TODO eran delete
201194
params.AddTechnologyIfNotExist(techutils.Poetry.String())
202195
rootNode, uniqueDeps, _, err := BuildDependencyTree(&params)
203196
if err != nil {

commands/audit/scarunner.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,6 @@ func buildDepTreeAndRunScaScan(auditParallelRunner *utils.SecurityParallelRunner
8585
// Make sure to return to the original working directory, buildDependencyTree may change it
8686
generalError = errors.Join(generalError, errorutils.CheckError(os.Chdir(currentWorkingDir)))
8787
}()
88-
/* TODO eran delete the special case for maven
89-
The code part from which this was copied is not trying to do the same, therefore this check for Maven is redundant.
90-
if we look at cli-security/cli/scancommands.go, AuditCmd we can see a loop that is referring maven specifically.
91-
in this loop we iterate all existing Technology types and check if a flag specifying each technology is provided.
92-
If so we add this technology to the audit params we use for the command execution.
93-
The reason for the specific reference for Maven is: the flag for Maven is 'mvn' and not similar to the name of the technology like the rest of the technologies
94-
Therefore, we check for the 'mvn' bool flag instead of 'maven' bool flag.
95-
This is NOT relevant here since the Technology is still Maven (techutils.Maven) and not the flags.mvn.
96-
*/
97-
/*
98-
if len(auditParams.Technologies()) == 0 {
99-
var technologies []string
100-
for _, tech := range cmdResults.GetTechnologies() {
101-
if tech == techutils.Maven {
102-
// On Maven we use '--mvn' flag
103-
technologies = append(technologies, flags.Mvn)
104-
} else {
105-
technologies = append(technologies, tech.String())
106-
}
107-
}
108-
auditParams.SetTechnologies(technologies)
109-
}
110-
*/
11188

11289
// Perform SCA scans
11390
for _, targetResult := range cmdResults.Targets {
@@ -259,7 +236,6 @@ func GetTechDependencyTree(params xrayutils.AuditParams, artifactoryServerDetail
259236

260237
switch tech {
261238
case techutils.Maven, techutils.Gradle:
262-
// TODO eran - if we changed python to work with auditParams do we want it here as well?
263239
depTreeResult.FullDepTrees, uniqDepsWithTypes, err = java.BuildDependencyTree(java.DepTreeParams{
264240
Server: artifactoryServerDetails,
265241
DepsRepo: params.DepsRepo(),
@@ -279,7 +255,6 @@ func GetTechDependencyTree(params xrayutils.AuditParams, artifactoryServerDetail
279255
case techutils.Go:
280256
depTreeResult.FullDepTrees, uniqueDeps, err = _go.BuildDependencyTree(params)
281257
case techutils.Pipenv, techutils.Pip, techutils.Poetry:
282-
// TODO eran - consider adding the tech here and not prior to this step in buildDepTreeAndRunScaScan. make sure to filer before adding to avoid duplicates (we can have dup if we came from CLI and not frogbot since we have tech flags)
283258
params.AddTechnologyIfNotExist(tech.String())
284259
depTreeResult.FullDepTrees, uniqueDeps,
285260
depTreeResult.DownloadUrls, err = python.BuildDependencyTree(params)

0 commit comments

Comments
 (0)