Skip to content

Commit

Permalink
Merge pull request #297 from Privado-Inc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pandurangpatil authored Jan 25, 2023
2 parents 2de5d14 + 669e5a8 commit c47db82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/main/scala/ai/privado/entrypoint/ScanProcessor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import org.slf4j.LoggerFactory
import java.util.Calendar
import scala.sys.exit
import scala.util.{Failure, Success, Try}
import scala.collection.parallel.CollectionConverters.ImmutableIterableIsParallelizable


object ScanProcessor extends CommandProcessor {
private val logger = LoggerFactory.getLogger(this.getClass)
Expand Down Expand Up @@ -78,7 +80,7 @@ object ScanProcessor extends CommandProcessor {
rule.language == langToFilter || rule.language == Language.DEFAULT || rule.language == Language.UNKNOWN
val parsedRules =
try
ir.listRecursively
ir.listRecursively.toList.par
.filter(f =>
((f.extension(toLowerCase = true).toString.contains(".yaml") ||
f.extension(toLowerCase = true).toString.contains(".yml")) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package ai.privado.languageEngine.java.passes.config

import ai.privado.cache.RuleCache
import ai.privado.model.RuleInfo
import ai.privado.utility.Utilities
import io.joern.x2cpg.SourceFiles
import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes}
import io.shiftleft.codepropertygraph.generated.nodes.{Literal, MethodParameterIn, NewFile, NewJavaProperty}
Expand Down Expand Up @@ -161,7 +162,9 @@ class PropertiesFilePass(cpg: Cpg, projectRoot: String) extends ForkJoinParallel
}

private def propertiesFiles(projectRoot: String): List[String] = {
SourceFiles.determine(Set(projectRoot), Set(".properties", ".yml", ".yaml"))
SourceFiles
.determine(Set(projectRoot), Set(".properties", ".yml", ".yaml"))
.filter(Utilities.isFileProcessable)
}

private def addFileNode(name: String, builder: BatchedUpdate.DiffGraphBuilder): NewFile = {
Expand Down

0 comments on commit c47db82

Please sign in to comment.