Repository: joernio/joern
Pull request #2185 (2023-01-17 10:57:18)

Hash optimisation
### Description
Converted started list to a hash set for better lookup performance.

### Testing done:

Snap task processing for snap cpg ( 385 MB ) comes down from 20-30 mins to 10 seconds on my machine.
No impact on smaller repositories since task processing is anyway in seconds.
Verified flow counts for `opencrx`, `privado-accounts-api` and `sms-backup-plus` CPGs by comparing with master.

Compared paths for `privado-accounts-api` generated by `master` and this branch and verified that there is no difference.





Patch:
diff --git a/.gitignore b/.gitignore
index 6885791b8..db9ed5ab3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ null
 .local
 **/astgen-win.exe
 **/astgen-macos
+**/astgen-macos-arm
 **/astgen-linux
 **/php2cpg/bin/vendor/
 **/php2cpg/bin/composer*
diff --git a/console/build.sbt b/console/build.sbt
index f1c7bdbec..b94df1919 100644
--- a/console/build.sbt
+++ b/console/build.sbt
@@ -6,7 +6,7 @@ val ScoptVersion          = "4.0.1"
 val BetterFilesVersion    = "3.9.1"
 val CaskVersion           = "0.8.3"
 val CirceVersion          = "0.14.3"
-val AmmoniteVersion       = "2.5.3"
+val AmmoniteVersion       = "2.5.6"
 val ZeroturnaroundVersion = "1.15"
 
 dependsOn(
diff --git a/console/src/main/java/io/github/retronym/java9rtexport/Export.java b/console/src/main/java/io/github/retronym/java9rtexport/Export.java
new file mode 100644
index 000000000..ed33a8fb2
--- /dev/null
+++ b/console/src/main/java/io/github/retronym/java9rtexport/Export.java
@@ -0,0 +1,129 @@
+/*
+Copyright (C) 2012-2014 EPFL
+Copyright (C) 2012-2014 Typesafe, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of the EPFL nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package io.github.retronym.java9rtexport;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.*;
+import java.nio.file.StandardCopyOption;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+
+/* TODO MP delete this file once it's fixed upstream - we're shadowing io.github.retronym.java9rtexport.Export
+ * which contains a bug for an edge case: the following line from `rtTo`
+ * java.nio.file.Files.copy(rt().toPath(), dest.toPath());
+ * throws an exception if run concurrently:
+ *
+ *   java.nio.file.FileAlreadyExistsException: /home/runner/.ammonite/rt-17.0.5.jar
+ *   	at java.base/sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:573)
+ *   	at java.base/sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:257)
+ *   	at java.base/java.nio.file.Files.copy(Files.java:1305)
+ *   	at io.github.retronym.java9rtexport.Export.rtTo(Export.java:88)
+ *   	at io.github.retronym.java9rtexport.Export.rtAt(Export.java:100)
+ *   	at io.github.retronym.java9rtexport.Export.rtAt(Export.java:105)
+ *   	at ammonite.util.Classpath$.classpath(Classpath.scala:76)
+ */
+
+public class Export {
+    private final static Object lock = new Object();
+    private static File tempFile = null;
+
+    public static String rtJarName = "rt-" + System.getProperty("java.version") + ".jar";
+
+    public static File rt() {
+        try {
+            synchronized (lock) {
+                if (tempFile == null) {
+                    Path tempPath = Files.createTempFile("rt", ".jar");
+                    tempFile = tempPath.toFile();
+                    tempFile.deleteOnExit();
+                    tempFile.delete();
+                    FileSystem fileSystem = FileSystems.getFileSystem(URI.create("jrt:/"));
+                    Path path = fileSystem.getPath("/modules");
+                    URI uri = URI.create("jar:" + tempPath.toUri());
+                    Map<String, String> env = new HashMap<>();
+                    env.put("create", "true");
+                    try (FileSystem zipfs = FileSystems.newFileSystem(uri, env)) {
+                        Iterator<Path> iterator = Files.list(path).iterator();
+                        while (iterator.hasNext()) {
+                            Path next = iterator.next();
+                            Copy.copyDirectory(next, zipfs.getPath("/"));
+                        }
+                    }
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            System.exit(-1);
+        }
+        return tempFile;
+    }
+
+    /**
+     * Needs to be `synchronized` because java.nio.file.Files.copy isn't thread safe:
+     * https://stackoverflow.com/questions/69796396/is-files-copy-a-thread-safe-function-in-java
+     * and our own handling of "if !exists, then copy" isn't either...
+     */
+    public static synchronized boolean rtTo(File dest, boolean verbose) {
+        try {
+            if (!dest.exists()) {
+                if (verbose) {
+                    System.out.println("Copying Java " +
+                            System.getProperty("java.version") +
+                            " runtime jar to " +
+                            dest.getParentFile() +
+                            " ...");
+                    System.out.flush();
+                }
+                dest.getParentFile().mkdirs();
+                java.nio.file.Files.copy(rt().toPath(), dest.toPath());
+                return true;
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            System.exit(-1);
+        }
+        return false;
+    }
+
+    public static File rtAt(File dir, boolean verbose) {
+        File f = new File(dir, rtJarName);
+        rtTo(f, verbose);
+        return f;
+    }
+
+    public static File rtAt(File dir) {
+        return rtAt(dir, false);
+    }
+}
diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala
index e5fd85780..41ab81c5e 100644
--- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala
+++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala
@@ -34,7 +34,7 @@ class Engine(context: EngineContext) {
     */
   private val mainResultTable: mutable.Map[TaskFingerprint, List[TableEntry]] = mutable.Map()
   private var numberOfTasksRunning: Int                                       = 0
-  private val started: mutable.Buffer[ReachableByTask]                        = mutable.Buffer()
+  private val started: mutable.HashSet[TaskFingerprint]                       = mutable.HashSet[TaskFingerprint]()
   private val held: mutable.Buffer[ReachableByTask]                           = mutable.Buffer()
 
   /** Determine flows from sources to sinks by exploring the graph backwards from sinks to sources. Returns the list of
@@ -110,17 +110,32 @@ class Engine(context: EngineContext) {
     }
 
     submitTasks(tasks.toVector, sources)
+    val startTimeSec: Long = System.currentTimeMillis / 1000
     runUntilAllTasksAreSolved()
+    val taskFinishTimeSec: Long = System.currentTimeMillis / 1000
+    logger.debug(
+      "Time measurement -----> Task processing done in " +
+        (taskFinishTimeSec - startTimeSec) + " seconds"
+    )
     new HeldTaskCompletion(held.toList, mainResultTable).completeHeldTasks()
-    deduplicateFinal(extractResultsFromTable(sinks))
+    val dedupResult          = deduplicateFinal(extractResultsFromTable(sinks))
+    val allDoneTimeSec: Long = System.currentTimeMillis / 1000
+
+    logger.debug(
+      "Time measurement -----> Task processing: " +
+        (taskFinishTimeSec - startTimeSec) + " seconds" +
+        ", Deduplication: " + (allDoneTimeSec - taskFinishTimeSec) +
+        ", Deduped results size: " + dedupResult.length
+    )
+    dedupResult
   }
 
   private def submitTasks(tasks: Vector[ReachableByTask], sources: Set[CfgNode]): Unit = {
     tasks.foreach { task =>
-      if (started.exists(x => x.fingerprint == task.fingerprint)) {
+      if (started.contains(task.fingerprint)) {
         held ++= Vector(task)
       } else {
-        started ++= Vector(task)
+        started.add(task.fingerprint)
         numberOfTasksRunning += 1
         completionService.submit(new TaskSolver(task, context, sources))
       }
diff --git a/joern-cli/frontends/jssrc2cpg/README.md b/joern-cli/frontends/jssrc2cpg/README.md
index 248e49eec..30a231680 100644
--- a/joern-cli/frontends/jssrc2cpg/README.md
+++ b/joern-cli/frontends/jssrc2cpg/README.md
@@ -18,8 +18,7 @@ of the build process. To build jssrc2cpg issue the command `sbt stage`.
 
 ## JS/TS AST Generation
 
-jssrc2cpg uses a modified version of [@joern/astgen](https://github.com/joernio/astgen) under the hood.
-That version is available [here](https://github.com/joernio/astgen).
+jssrc2cpg uses [@joern/astgen](https://github.com/joernio/astgen) under the hood.
 Native binaries for Linux, macOS, and Windows are generated as described [here](https://github.com/joernio/astgen#building).
 To build your own native binaries run the following commands:
 
@@ -30,7 +29,7 @@ yarn install
 ```
 (requires `yarn`).
 
-Copy the resulting `astgen-linux`, `astgen-macos`, and `astgen-win.exe` to `joern/joern-cli/frontends/jssrc2cpg/bin/astgen`.
+Copy the resulting `astgen-linux`, `astgen-macos`, `astgen-macos-arm`, and `astgen-win.exe` to `joern/joern-cli/frontends/jssrc2cpg/bin/astgen`.
 
 ## Running
 
@@ -47,3 +46,4 @@ Run the following to see a complete list of available options:
 ## Warning
 
 This is work in progress. Use https://github.com/ShiftLeftSecurity/js2cpg as a mature alternative.
+
diff --git a/joern-cli/frontends/jssrc2cpg/build.sbt b/joern-cli/frontends/jssrc2cpg/build.sbt
index 5c6ee6333..4f0adcf4a 100644
--- a/joern-cli/frontends/jssrc2cpg/build.sbt
+++ b/joern-cli/frontends/jssrc2cpg/build.sbt
@@ -4,7 +4,7 @@ crossScalaVersions := Seq("2.13.8", "3.2.1")
 
 dependsOn(Projects.dataflowengineoss, Projects.x2cpg % "compile->compile;test->test")
 
-val astGenVersion = "2.9.0"
+val astGenVersion = "2.10.0"
 
 libraryDependencies ++= Seq(
   "io.shiftleft"              %% "codepropertygraph" % Versions.cpg,
@@ -66,7 +66,7 @@ Test / fork := false
 enablePlugins(JavaAppPackaging, LauncherJarPlugin)
 
 lazy val astGenDlUrl       = s"https://github.com/joernio/astgen/releases/download/v$astGenVersion/"
-lazy val astGenBinaryNames = Seq("astgen-linux", "astgen-macos", "astgen-win.exe")
+lazy val astGenBinaryNames = Seq("astgen-linux", "astgen-macos", "astgen-macos-arm", "astgen-win.exe")
 
 lazy val astGenDlTask = taskKey[Unit](s"Download astgen binaries")
 astGenDlTask := {
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala
index 61c734674..67de0275f 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala
@@ -105,7 +105,7 @@ class AstCreator(
 
     methodAstParentStack.push(programMethod)
 
-    val blockNode = NewBlock().typeFullName(Defines.ANY)
+    val blockNode = NewBlock().typeFullName(Defines.Any)
 
     scope.pushNewMethodScope(fullName, name, blockNode, None)
     localAstParentStack.push(blockNode)
@@ -119,7 +119,7 @@ class AstCreator(
     val methodReturn = NewMethodReturn()
       .code("RET")
       .evaluationStrategy(EvaluationStrategies.BY_VALUE)
-      .typeFullName(Defines.ANY)
+      .typeFullName(Defines.Any)
 
     localAstParentStack.pop()
     scope.popScope()
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala
index 6bbfc178e..1c39cc6ca 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala
@@ -23,8 +23,8 @@ import scala.util.Try
 trait AstCreatorHelper { this: AstCreator =>
 
   // maximum length of code fields in number of characters
-  private val MAX_CODE_LENGTH: Int = 1000
-  private val MIN_CODE_LENGTH: Int = 50
+  private val MaxCodeLength: Int = 1000
+  private val MinCodeLength: Int = 50
 
   protected def createBabelNodeInfo(json: Value): BabelNodeInfo = {
     val c     = shortenCode(code(json))
@@ -69,7 +69,7 @@ trait AstCreatorHelper { this: AstCreator =>
       .orElse(codeForBabelNodeInfo(nodeInfo).headOption)
       .getOrElse {
         val tmpName   = generateUnusedVariableName(usedVariableNames, "_tmp")
-        val localNode = createLocalNode(tmpName, Defines.ANY)
+        val localNode = createLocalNode(tmpName, Defines.Any)
         diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
         tmpName
       }
@@ -91,8 +91,8 @@ trait AstCreatorHelper { this: AstCreator =>
     parserResult.fileContent.substring(startIndex, endIndex).trim
   }
 
-  private def shortenCode(code: String, length: Int = MAX_CODE_LENGTH): String =
-    StringUtils.abbreviate(code, math.max(MIN_CODE_LENGTH, length))
+  private def shortenCode(code: String, length: Int = MaxCodeLength): String =
+    StringUtils.abbreviate(code, math.max(MinCodeLength, length))
 
   protected def hasKey(node: Value, key: String): Boolean = Try(node(key)).isSuccess
 
@@ -269,7 +269,7 @@ trait AstCreatorHelper { this: AstCreator =>
                   case None =>
                     val methodScopeNode = methodScope.scopeNode
                     val localNode =
-                      createLocalNode(origin.variableName, Defines.ANY, Option(closureBindingIdProperty))
+                      createLocalNode(origin.variableName, Defines.Any, Option(closureBindingIdProperty))
                     diffGraph.addEdge(methodScopeNode, localNode, EdgeTypes.AST)
                     val closureBindingNode = createClosureBindingNode(closureBindingIdProperty, origin.variableName)
                     methodScope.capturingRefId.foreach(ref =>
@@ -301,7 +301,7 @@ trait AstCreatorHelper { this: AstCreator =>
     methodScopeNodeId: NewNode,
     variableName: String
   ): (NewNode, ScopeType) = {
-    val local = createLocalNode(variableName, Defines.ANY)
+    val local = createLocalNode(variableName, Defines.Any)
     diffGraph.addEdge(methodScopeNodeId, local, EdgeTypes.AST)
     (local, MethodScope)
   }
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala
index 3d0df0da0..60b5d25f5 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala
@@ -17,10 +17,10 @@ import scala.util.Try
 
 trait AstForDeclarationsCreator { this: AstCreator =>
 
-  private val DEFAULTS_KEY    = "default"
-  private val EXPORT_KEYWORD  = "exports"
-  private val REQUIRE_KEYWORD = "require"
-  private val IMPORT_KEYWORD  = "import"
+  private val DefaultsKey    = "default"
+  private val ExportKeyword  = "exports"
+  private val RequireKeyword = "require"
+  private val ImportKeyword  = "import"
 
   private def hasName(json: Value): Boolean = hasKey(json, "id") && !json("id").isNull
 
@@ -48,12 +48,12 @@ trait AstForDeclarationsCreator { this: AstCreator =>
   }
 
   private def createExportCallAst(name: String, exportName: String, declaration: BabelNodeInfo): Ast = {
-    val exportCallAst = if (name == DEFAULTS_KEY) {
+    val exportCallAst = if (name == DefaultsKey) {
       createIndexAccessCallAst(
         createIdentifierNode(exportName, declaration),
         createLiteralNode(
-          s"\"$DEFAULTS_KEY\"",
-          Option(Defines.STRING),
+          s"\"$DefaultsKey\"",
+          Option(Defines.String),
           declaration.lineNumber,
           declaration.columnNumber
         ),
@@ -92,7 +92,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       }
 
   private def extractExportFromNameFromExportDecl(declaration: BabelNodeInfo): String =
-    safeObj(declaration.json, "source").fold(EXPORT_KEYWORD) { d => s"_${stripQuotes(code(d))}" }
+    safeObj(declaration.json, "source").fold(ExportKeyword) { d => s"_${stripQuotes(code(d))}" }
 
   private def cleanImportName(name: String): String = if (name.contains("/")) {
     val stripped = name.stripSuffix("/")
@@ -100,12 +100,12 @@ trait AstForDeclarationsCreator { this: AstCreator =>
   } else name
 
   private def createAstForFrom(fromName: String, declaration: BabelNodeInfo): Ast = {
-    if (fromName == EXPORT_KEYWORD) {
+    if (fromName == ExportKeyword) {
       Ast()
     } else {
       val strippedCode = cleanImportName(fromName).stripPrefix("_")
       val id           = createIdentifierNode(s"_$strippedCode", declaration)
-      val localNode    = createLocalNode(id.code, Defines.ANY)
+      val localNode    = createLocalNode(id.code, Defines.Any)
       scope.addVariable(id.code, localNode, BlockScope)
       scope.addVariableReference(id.code, id)
       diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
@@ -113,8 +113,8 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       val sourceCallArgNode =
         createLiteralNode(s"\"${fromName.stripPrefix("_")}\"", None, declaration.lineNumber, declaration.columnNumber)
       val sourceCall = createCallNode(
-        s"$REQUIRE_KEYWORD(${sourceCallArgNode.code})",
-        REQUIRE_KEYWORD,
+        s"$RequireKeyword(${sourceCallArgNode.code})",
+        RequireKeyword,
         DispatchTypes.STATIC_DISPATCH,
         declaration.lineNumber,
         declaration.columnNumber
@@ -158,8 +158,8 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val declAstAndNames = extractDeclarationsFromExportDecl(declaration, "declaration")
     val declAsts = declAstAndNames.toList.map { case (ast, names) =>
       ast +: names.map { name =>
-        if (exportName != EXPORT_KEYWORD)
-          diffGraph.addNode(createDependencyNode(name, exportName.stripPrefix("_"), REQUIRE_KEYWORD))
+        if (exportName != ExportKeyword)
+          diffGraph.addNode(createDependencyNode(name, exportName.stripPrefix("_"), RequireKeyword))
         val exportCallAst = createExportCallAst(name, exportName, declaration)
         createExportAssignmentCallAst(name, exportCallAst, declaration)
       }
@@ -167,13 +167,13 @@ trait AstForDeclarationsCreator { this: AstCreator =>
 
     val specifierAsts = specifiers.map {
       case (Some(name), Some(alias)) =>
-        if (exportName != EXPORT_KEYWORD)
-          diffGraph.addNode(createDependencyNode(alias.code, exportName.stripPrefix("_"), REQUIRE_KEYWORD))
+        if (exportName != ExportKeyword)
+          diffGraph.addNode(createDependencyNode(alias.code, exportName.stripPrefix("_"), RequireKeyword))
         val exportCallAst = createExportCallAst(alias.code, exportName, declaration)
         createExportAssignmentCallAst(name.code, exportCallAst, declaration)
       case (None, Some(alias)) =>
-        diffGraph.addNode(createDependencyNode(alias.code, exportName.stripPrefix("_"), REQUIRE_KEYWORD))
-        val exportCallAst = createExportCallAst(alias.code, EXPORT_KEYWORD, declaration)
+        diffGraph.addNode(createDependencyNode(alias.code, exportName.stripPrefix("_"), RequireKeyword))
+        val exportCallAst = createExportCallAst(alias.code, ExportKeyword, declaration)
         createExportAssignmentCallAst(exportName, exportCallAst, declaration)
       case _ => Ast()
     }
@@ -187,7 +187,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val expressionAstWithNames = extractDeclarationsFromExportDecl(assignment, "expression")
     val declAsts = expressionAstWithNames.map { case (ast, names) =>
       ast +: names.map { name =>
-        val exportCallAst = createExportCallAst(name, EXPORT_KEYWORD, assignment)
+        val exportCallAst = createExportCallAst(name, ExportKeyword, assignment)
         createExportAssignmentCallAst(name, exportCallAst, assignment)
       }
     }
@@ -203,7 +203,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
 
     val declAsts = declAstAndNames.map { case (ast, names) =>
       ast +: names.map { name =>
-        val exportCallAst = createExportCallAst(DEFAULTS_KEY, exportName, declaration)
+        val exportCallAst = createExportCallAst(DefaultsKey, exportName, declaration)
         createExportAssignmentCallAst(name, exportCallAst, declaration)
       }
     }
@@ -217,12 +217,12 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val exportName = extractExportFromNameFromExportDecl(declaration)
     val depGroupId = stripQuotes(code(declaration.json("source")))
     val name       = cleanImportName(depGroupId)
-    if (exportName != EXPORT_KEYWORD) {
-      diffGraph.addNode(createDependencyNode(name, depGroupId, REQUIRE_KEYWORD))
+    if (exportName != ExportKeyword) {
+      diffGraph.addNode(createDependencyNode(name, depGroupId, RequireKeyword))
     }
 
     val fromCallAst       = createAstForFrom(exportName, declaration)
-    val exportCallAst     = createExportCallAst(name, EXPORT_KEYWORD, declaration)
+    val exportCallAst     = createExportCallAst(name, ExportKeyword, declaration)
     val assignmentCallAst = createExportAssignmentCallAst(s"_$name", exportCallAst, declaration)
 
     val asts = List(fromCallAst, assignmentCallAst)
@@ -252,7 +252,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
 
   private def handleRequireCallForDependencies(declarator: BabelNodeInfo, lhs: Value, rhs: Value): Unit = {
     val rhsCode  = code(rhs)
-    val groupId  = rhsCode.substring(rhsCode.indexOf(s"$REQUIRE_KEYWORD(") + 9, rhsCode.indexOf(")") - 1)
+    val groupId  = rhsCode.substring(rhsCode.indexOf(s"$RequireKeyword(") + 9, rhsCode.indexOf(")") - 1)
     val nodeInfo = createBabelNodeInfo(lhs)
     val names = nodeInfo.node match {
       case ArrayPattern  => nodeInfo.json("elements").arr.toList.map(code)
@@ -260,7 +260,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       case _             => List(code(lhs))
     }
     names.foreach { name =>
-      val dependencyNode = createDependencyNode(name, groupId, REQUIRE_KEYWORD)
+      val dependencyNode = createDependencyNode(name, groupId, RequireKeyword)
       diffGraph.addNode(dependencyNode)
       val importNode = createImportNodeAndAttachToAst(declarator, groupId, name)
       diffGraph.addEdge(importNode, dependencyNode, EdgeTypes.IMPORTS)
@@ -283,7 +283,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       Ast()
     } else {
       val sourceAst = initNodeInfo.get match {
-        case requireCall if requireCall.code.startsWith(s"$REQUIRE_KEYWORD(") =>
+        case requireCall if requireCall.code.startsWith(s"$RequireKeyword(") =>
           handleRequireCallForDependencies(createBabelNodeInfo(declarator), idNodeInfo.json, initNodeInfo.get.json)
           astForNodeWithFunctionReference(requireCall.json)
         case initExpr =>
@@ -319,7 +319,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       case TSExternalModuleReference => referenceNode.json("expression")("value").str
       case _                         => referenceNode.code
     }
-    val dependencyNode = createDependencyNode(name, referenceName, IMPORT_KEYWORD)
+    val dependencyNode = createDependencyNode(name, referenceName, ImportKeyword)
     diffGraph.addNode(dependencyNode)
     val importNode = createImportNodeAndAttachToAst(impDecl, referenceName, name)
     diffGraph.addEdge(importNode, dependencyNode, EdgeTypes.IMPORTS)
@@ -335,7 +335,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
   ): Ast = {
     val destName  = alias.getOrElse(name)
     val destNode  = createIdentifierNode(destName, nodeInfo)
-    val localNode = createLocalNode(destName, Defines.ANY)
+    val localNode = createLocalNode(destName, Defines.Any)
     scope.addVariable(destName, localNode, BlockScope)
     scope.addVariableReference(destName, destNode)
     diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
@@ -343,14 +343,14 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val destAst           = Ast(destNode)
     val sourceCallArgNode = createLiteralNode(s"\"$from\"", None, nodeInfo.lineNumber, nodeInfo.columnNumber)
     val sourceCall = createCallNode(
-      s"$REQUIRE_KEYWORD(${sourceCallArgNode.code})",
-      REQUIRE_KEYWORD,
+      s"$RequireKeyword(${sourceCallArgNode.code})",
+      RequireKeyword,
       DispatchTypes.DYNAMIC_DISPATCH,
       nodeInfo.lineNumber,
       nodeInfo.columnNumber
     )
 
-    val receiverNode = createIdentifierNode(REQUIRE_KEYWORD, nodeInfo)
+    val receiverNode = createIdentifierNode(RequireKeyword, nodeInfo)
     val thisNode     = createIdentifierNode("this", nodeInfo)
     scope.addVariableReference(thisNode.name, thisNode)
     val callAst = createCallAst(
@@ -386,7 +386,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val specifiers = impDecl.json("specifiers").arr
 
     if (specifiers.isEmpty) {
-      val dependencyNode = createDependencyNode(source, source, IMPORT_KEYWORD)
+      val dependencyNode = createDependencyNode(source, source, ImportKeyword)
       diffGraph.addNode(dependencyNode)
       val importNode = createImportNodeAndAttachToAst(impDecl, source, source)
       diffGraph.addEdge(importNode, dependencyNode, EdgeTypes.IMPORTS)
@@ -396,7 +396,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
       val depNodes = specs.map { importSpecifier =>
         val importedName   = importSpecifier("local")("name").str
         val importNode     = createImportNodeAndAttachToAst(impDecl, source, importedName)
-        val dependencyNode = createDependencyNode(importedName, source, IMPORT_KEYWORD)
+        val dependencyNode = createDependencyNode(importedName, source, ImportKeyword)
         diffGraph.addEdge(importNode, dependencyNode, EdgeTypes.IMPORTS)
         dependencyNode
       }
@@ -439,7 +439,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
   private def convertDestructingObjectElement(element: BabelNodeInfo, key: BabelNodeInfo, localTmpName: String): Ast = {
     val valueAst = astForNode(element.json)
 
-    val localNode = createLocalNode(element.code, Defines.ANY)
+    val localNode = createLocalNode(element.code, Defines.Any)
     diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
     scope.addVariable(element.code, localNode, MethodScope)
 
@@ -458,13 +458,13 @@ trait AstForDeclarationsCreator { this: AstCreator =>
   private def convertDestructingArrayElement(element: BabelNodeInfo, index: Int, localTmpName: String): Ast = {
     val valueAst = astForNode(element.json)
 
-    val localNode = createLocalNode(element.code, Defines.ANY)
+    val localNode = createLocalNode(element.code, Defines.Any)
     diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
     scope.addVariable(element.code, localNode, MethodScope)
 
     val fieldAccessTmpNode = createIdentifierNode(localTmpName, element)
     val keyNode =
-      createLiteralNode(index.toString, Option(Defines.NUMBER), element.lineNumber, element.columnNumber)
+      createLiteralNode(index.toString, Option(Defines.Number), element.lineNumber, element.columnNumber)
     val accessAst = createIndexAccessCallAst(fieldAccessTmpNode, keyNode, element.lineNumber, element.columnNumber)
     createAssignmentCallAst(
       valueAst,
@@ -495,7 +495,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val testAst = {
       val fieldAccessTmpNode = createIdentifierNode(localTmpName, element)
       val keyNode =
-        createLiteralNode(index.toString, Option(Defines.NUMBER), element.lineNumber, element.columnNumber)
+        createLiteralNode(index.toString, Option(Defines.Number), element.lineNumber, element.columnNumber)
       val accessAst =
         createIndexAccessCallAst(fieldAccessTmpNode, keyNode, element.lineNumber, element.columnNumber)
       val voidCallNode = createVoidCallNode(element.lineNumber, element.columnNumber)
@@ -504,7 +504,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     val falseAst = {
       val fieldAccessTmpNode = createIdentifierNode(localTmpName, element)
       val keyNode =
-        createLiteralNode(index.toString, Option(Defines.NUMBER), element.lineNumber, element.columnNumber)
+        createLiteralNode(index.toString, Option(Defines.Number), element.lineNumber, element.columnNumber)
       createIndexAccessCallAst(fieldAccessTmpNode, keyNode, element.lineNumber, element.columnNumber)
     }
     val ternaryNodeAst =
@@ -593,7 +593,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
     scope.pushNewBlockScope(blockNode)
     localAstParentStack.push(blockNode)
 
-    val localNode = createLocalNode(localTmpName, Defines.ANY)
+    val localNode = createLocalNode(localTmpName, Defines.Any)
     val tmpNode   = createIdentifierNode(localTmpName, pattern)
     diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
     scope.addVariable(localTmpName, localNode, BlockScope)
@@ -640,7 +640,7 @@ trait AstForDeclarationsCreator { this: AstCreator =>
               case RestElement =>
                 val fieldAccessTmpNode = createIdentifierNode(localTmpName, nodeInfo)
                 val keyNode =
-                  createLiteralNode(index.toString, Option(Defines.NUMBER), nodeInfo.lineNumber, nodeInfo.columnNumber)
+                  createLiteralNode(index.toString, Option(Defines.Number), nodeInfo.lineNumber, nodeInfo.columnNumber)
                 val accessAst =
                   createIndexAccessCallAst(fieldAccessTmpNode, keyNode, nodeInfo.lineNumber, nodeInfo.columnNumber)
                 astForSpreadOrRestElement(nodeInfo, Option(accessAst))
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
index 1b57c9f09..7ec8e1fcf 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
@@ -89,7 +89,7 @@ trait AstForExpressionsCreator { this: AstCreator =>
   protected def astForThisExpression(thisExpr: BabelNodeInfo): Ast = {
     val thisNode = createIdentifierNode(
       thisExpr.code,
-      dynamicInstanceTypeStack.headOption.orElse(Option(Defines.ANY)),
+      dynamicInstanceTypeStack.headOption.orElse(Option(Defines.Any)),
       thisExpr.lineNumber,
       thisExpr.columnNumber
     )
@@ -105,7 +105,7 @@ trait AstForExpressionsCreator { this: AstCreator =>
     localAstParentStack.push(blockNode)
 
     val tmpAllocName      = generateUnusedVariableName(usedVariableNames, "_tmp")
-    val localTmpAllocNode = createLocalNode(tmpAllocName, Defines.ANY)
+    val localTmpAllocNode = createLocalNode(tmpAllocName, Defines.Any)
     val tmpAllocNode1     = createIdentifierNode(tmpAllocName, newExpr)
     diffGraph.addEdge(localAstParentStack.head, localTmpAllocNode, EdgeTypes.AST)
     scope.addVariableReference(tmpAllocName, tmpAllocNode1)
@@ -373,7 +373,7 @@ trait AstForExpressionsCreator { this: AstCreator =>
       localAstParentStack.push(blockNode)
 
       val tmpName      = generateUnusedVariableName(usedVariableNames, "_tmp")
-      val localTmpNode = createLocalNode(tmpName, Defines.ANY)
+      val localTmpNode = createLocalNode(tmpName, Defines.Any)
       val tmpArrayNode = createIdentifierNode(tmpName, arrExpr)
       diffGraph.addEdge(localAstParentStack.head, localTmpNode, EdgeTypes.AST)
       scope.addVariableReference(tmpName, tmpArrayNode)
@@ -462,7 +462,7 @@ trait AstForExpressionsCreator { this: AstCreator =>
     localAstParentStack.push(blockNode)
 
     val tmpName   = generateUnusedVariableName(usedVariableNames, "_tmp")
-    val localNode = createLocalNode(tmpName, Defines.ANY)
+    val localNode = createLocalNode(tmpName, Defines.Any)
     diffGraph.addEdge(localAstParentStack.head, localNode, EdgeTypes.AST)
 
     val propertiesAsts = objExpr.json("properties").arr.toList.map { property =>
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala
index 1b066f419..2c912755c 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala
@@ -11,7 +11,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     val name      = ident.json("name").str
     val identNode = createIdentifierNode(name, ident)
     val tpe = typeFullName match {
-      case Some(Defines.ANY) => typeFor(ident)
+      case Some(Defines.Any) => typeFor(ident)
       case Some(otherType)   => otherType
       case None              => typeFor(ident)
     }
@@ -27,11 +27,11 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(createIdentifierNode("import", importKeyword))
 
   protected def astForNullLiteral(nullLiteral: BabelNodeInfo): Ast =
-    Ast(createLiteralNode(nullLiteral.code, Option(Defines.NULL), nullLiteral.lineNumber, nullLiteral.columnNumber))
+    Ast(createLiteralNode(nullLiteral.code, Option(Defines.Null), nullLiteral.lineNumber, nullLiteral.columnNumber))
 
   protected def astForStringLiteral(stringLiteral: BabelNodeInfo): Ast = {
     val code = s"\"${stringLiteral.json("value").str}\""
-    Ast(createLiteralNode(code, Option(Defines.STRING), stringLiteral.lineNumber, stringLiteral.columnNumber))
+    Ast(createLiteralNode(code, Option(Defines.String), stringLiteral.lineNumber, stringLiteral.columnNumber))
   }
 
   protected def astForPrivateName(privateName: BabelNodeInfo): Ast =
@@ -53,7 +53,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         s"\"${templateElement.json("value")("raw").str}\"",
-        Option(Defines.STRING),
+        Option(Defines.String),
         templateElement.lineNumber,
         templateElement.columnNumber
       )
@@ -63,7 +63,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         regExpLiteral.code,
-        Option(Defines.STRING),
+        Option(Defines.String),
         regExpLiteral.lineNumber,
         regExpLiteral.columnNumber
       )
@@ -71,14 +71,14 @@ trait AstForPrimitivesCreator { this: AstCreator =>
 
   protected def astForRegexLiteral(regexLiteral: BabelNodeInfo): Ast =
     Ast(
-      createLiteralNode(regexLiteral.code, Option(Defines.STRING), regexLiteral.lineNumber, regexLiteral.columnNumber)
+      createLiteralNode(regexLiteral.code, Option(Defines.String), regexLiteral.lineNumber, regexLiteral.columnNumber)
     )
 
   protected def astForNumberLiteral(numberLiteral: BabelNodeInfo): Ast =
     Ast(
       createLiteralNode(
         numberLiteral.code,
-        Option(Defines.NUMBER),
+        Option(Defines.Number),
         numberLiteral.lineNumber,
         numberLiteral.columnNumber
       )
@@ -88,7 +88,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         numericLiteral.code,
-        Option(Defines.NUMBER),
+        Option(Defines.Number),
         numericLiteral.lineNumber,
         numericLiteral.columnNumber
       )
@@ -98,7 +98,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         decimalLiteral.code,
-        Option(Defines.NUMBER),
+        Option(Defines.Number),
         decimalLiteral.lineNumber,
         decimalLiteral.columnNumber
       )
@@ -108,7 +108,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         bigIntLiteral.code,
-        Option(Defines.NUMBER),
+        Option(Defines.Number),
         bigIntLiteral.lineNumber,
         bigIntLiteral.columnNumber
       )
@@ -118,7 +118,7 @@ trait AstForPrimitivesCreator { this: AstCreator =>
     Ast(
       createLiteralNode(
         booleanLiteral.code,
-        Option(Defines.BOOLEAN),
+        Option(Defines.Boolean),
         booleanLiteral.lineNumber,
         booleanLiteral.columnNumber
       )
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala
index 4d790e04c..83711eccc 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala
@@ -137,7 +137,7 @@ trait AstForStatementsCreator { this: AstCreator =>
       astForNodeWithFunctionReference(Obj(init))
     }
     val testAst = safeObj(forStmt.json, "test").fold(
-      Ast(createLiteralNode("true", Option(Defines.BOOLEAN), forStmt.lineNumber, forStmt.columnNumber))
+      Ast(createLiteralNode("true", Option(Defines.Boolean), forStmt.lineNumber, forStmt.columnNumber))
     ) { test =>
       astForNodeWithFunctionReference(Obj(test))
     }
@@ -279,7 +279,7 @@ trait AstForStatementsCreator { this: AstCreator =>
 
     // _iterator assignment:
     val iteratorName      = generateUnusedVariableName(usedVariableNames, "_iterator")
-    val iteratorLocalNode = createLocalNode(iteratorName, Defines.ANY)
+    val iteratorLocalNode = createLocalNode(iteratorName, Defines.Any)
     val iteratorNode      = createIdentifierNode(iteratorName, forInOfStmt)
     diffGraph.addEdge(localAstParentStack.head, iteratorLocalNode, EdgeTypes.AST)
     scope.addVariableReference(iteratorName, iteratorNode)
@@ -340,7 +340,7 @@ trait AstForStatementsCreator { this: AstCreator =>
 
     // _result:
     val resultName      = generateUnusedVariableName(usedVariableNames, "_result")
-    val resultLocalNode = createLocalNode(resultName, Defines.ANY)
+    val resultLocalNode = createLocalNode(resultName, Defines.Any)
     val resultNode      = createIdentifierNode(resultName, forInOfStmt)
     diffGraph.addEdge(localAstParentStack.head, resultLocalNode, EdgeTypes.AST)
     scope.addVariableReference(resultName, resultNode)
@@ -352,7 +352,7 @@ trait AstForStatementsCreator { this: AstCreator =>
       case _                   => code(nodeInfo.json)
     }
 
-    val loopVariableLocalNode = createLocalNode(loopVariableName, Defines.ANY)
+    val loopVariableLocalNode = createLocalNode(loopVariableName, Defines.Any)
     val loopVariableNode      = createIdentifierNode(loopVariableName, forInOfStmt)
     diffGraph.addEdge(localAstParentStack.head, loopVariableLocalNode, EdgeTypes.AST)
     scope.addVariableReference(loopVariableName, loopVariableNode)
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala
index afe403939..611e1074e 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala
@@ -39,7 +39,7 @@ trait AstForTypesCreator { this: AstCreator =>
     seenAliasTypes.add(aliasTypeDeclNode)
 
     val typeDeclNodeAst =
-      if (!Defines.JSTYPES.contains(name) && !seenAliasTypes.exists(_.name == name)) {
+      if (!Defines.JsTypes.contains(name) && !seenAliasTypes.exists(_.name == name)) {
         val (typeName, typeFullName) = calcTypeNameAndFullName(alias, Option(name))
         val typeDeclNode = createTypeDeclNode(
           typeName,
@@ -235,7 +235,7 @@ trait AstForTypesCreator { this: AstCreator =>
       Ast.storeInDiffGraph(Ast(typeDeclNode).withChildren(member), diffGraph)
     } else {
       val init =
-        staticInitMethodAst(calls, s"$typeFullName:${io.joern.x2cpg.Defines.StaticInitMethodName}", None, Defines.ANY)
+        staticInitMethodAst(calls, s"$typeFullName:${io.joern.x2cpg.Defines.StaticInitMethodName}", None, Defines.Any)
       Ast.storeInDiffGraph(Ast(typeDeclNode).withChildren(member).withChild(init), diffGraph)
     }
 
@@ -327,7 +327,7 @@ trait AstForTypesCreator { this: AstCreator =>
         staticMemberInitCalls ++ staticInitBlockAsts,
         s"$typeFullName:${io.joern.x2cpg.Defines.StaticInitMethodName}",
         None,
-        Defines.ANY
+        Defines.Any
       )
       Ast.storeInDiffGraph(init, diffGraph)
       diffGraph.addEdge(typeDeclNode, init.nodes.head, EdgeTypes.AST)
@@ -342,7 +342,7 @@ trait AstForTypesCreator { this: AstCreator =>
         createIdentifierNode(typeName, Option(constructorNode.fullName), clazz.lineNumber, clazz.columnNumber)
       val constructorRefNode = createMethodRefNode(constructorNode.code, constructorNode.fullName, clazz)
 
-      val idLocal = createLocalNode(typeName, Defines.ANY)
+      val idLocal = createLocalNode(typeName, Defines.Any)
       diffGraph.addEdge(localAstParentStack.head, idLocal, EdgeTypes.AST)
       scope.addVariable(typeName, idLocal, BlockScope)
       scope.addVariableReference(typeName, classIdNode)
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala
index 26c00d8f1..eff98ab37 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala
@@ -167,7 +167,7 @@ trait AstNodeBuilder { this: AstCreator =>
       .evaluationStrategy(EvaluationStrategies.BY_VALUE)
       .lineNumber(line)
       .columnNumber(column)
-      .typeFullName(tpe.getOrElse(Defines.ANY))
+      .typeFullName(tpe.getOrElse(Defines.Any))
     scope.addVariable(name, param, MethodScope)
     param
   }
@@ -199,7 +199,7 @@ trait AstNodeBuilder { this: AstCreator =>
     NewMember()
       .code(code)
       .name(name)
-      .typeFullName(Defines.ANY)
+      .typeFullName(Defines.Any)
       .dynamicTypeHintFullName(dynamicTypeOption.toList)
 
   protected def createMethodNode(methodName: String, methodFullName: String, func: BabelNodeInfo): NewMethod = {
@@ -321,7 +321,7 @@ trait AstNodeBuilder { this: AstCreator =>
     .dispatchType(dispatchType)
     .lineNumber(line)
     .columnNumber(column)
-    .typeFullName(Defines.ANY)
+    .typeFullName(Defines.Any)
 
   protected def createVoidCallNode(line: Option[Integer], column: Option[Integer]): NewCall =
     createCallNode("void 0", "<operator>.void", DispatchTypes.STATIC_DISPATCH, line, column)
@@ -346,8 +346,8 @@ trait AstNodeBuilder { this: AstCreator =>
     column: Option[Integer]
   ): NewLiteral = {
     val typeFullName = dynamicTypeOption match {
-      case Some(value) if Defines.JSTYPES.contains(value) => value
-      case _                                              => Defines.ANY
+      case Some(value) if Defines.JsTypes.contains(value) => value
+      case _                                              => Defines.Any
     }
     NewLiteral()
       .code(code)
@@ -391,8 +391,8 @@ trait AstNodeBuilder { this: AstCreator =>
   protected def createIdentifierNode(name: String, node: BabelNodeInfo): NewIdentifier = {
     val dynamicInstanceTypeOption = name match {
       case "this"    => dynamicInstanceTypeStack.headOption
-      case "console" => Option(Defines.CONSOLE)
-      case "Math"    => Option(Defines.MATH)
+      case "console" => Option(Defines.Console)
+      case "Math"    => Option(Defines.Math)
       case _         => None
     }
     createIdentifierNode(name, dynamicInstanceTypeOption, node.lineNumber, node.columnNumber)
@@ -408,7 +408,7 @@ trait AstNodeBuilder { this: AstCreator =>
     .code(name)
     .lineNumber(line)
     .columnNumber(column)
-    .typeFullName(Defines.ANY)
+    .typeFullName(Defines.Any)
     .dynamicTypeHintFullName(dynamicTypeOption.toList)
 
   protected def createStaticCallNode(
@@ -425,7 +425,7 @@ trait AstNodeBuilder { this: AstCreator =>
     .signature("")
     .lineNumber(line)
     .columnNumber(column)
-    .typeFullName(Defines.ANY)
+    .typeFullName(Defines.Any)
 
   protected def createLocalNode(name: String, typeFullName: String, closureBindingId: Option[String] = None): NewLocal =
     NewLocal().code(name).name(name).typeFullName(typeFullName).closureBindingId(closureBindingId).order(0)
@@ -452,7 +452,7 @@ trait AstNodeBuilder { this: AstCreator =>
 
   protected def createBlockNode(node: BabelNodeInfo, customCode: Option[String] = None): NewBlock =
     NewBlock()
-      .typeFullName(Defines.ANY)
+      .typeFullName(Defines.Any)
       .code(customCode.getOrElse(node.code))
       .lineNumber(node.lineNumber)
       .columnNumber(node.columnNumber)
@@ -476,7 +476,7 @@ trait AstNodeBuilder { this: AstCreator =>
         methodName,
         astParentType = astParentType,
         astParentFullName = astParentFullName
-      ).inheritsFromTypeFullName(List(Defines.ANY))
+      ).inheritsFromTypeFullName(List(Defines.Any))
 
     // Problem for https://github.com/ShiftLeftSecurity/codescience/issues/3626 here.
     // As the type (thus, the signature) of the function node is unknown (i.e., ANY*)
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala
index 823226532..2c31577a7 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala
@@ -6,16 +6,16 @@ import io.joern.jssrc2cpg.passes.Defines
 
 trait TypeHelper { this: AstCreator =>
 
-  private val TYPE_ANNOTATION_KEY = "typeAnnotation"
-  private val RETURN_TYPE_KEY     = "returnType"
+  private val TypeAnnotationKey = "typeAnnotation"
+  private val ReturnTypeKey     = "returnType"
 
-  private val TYPE_REPLACEMENTS = Map(
-    " any"     -> s" ${Defines.ANY}",
-    " number"  -> s" ${Defines.NUMBER}",
-    " null"    -> s" ${Defines.NULL}",
-    " string"  -> s" ${Defines.STRING}",
-    " boolean" -> s" ${Defines.BOOLEAN}",
-    "{}"       -> Defines.OBJECT,
+  private val TypeReplacements = Map(
+    " any"     -> s" ${Defines.Any}",
+    " number"  -> s" ${Defines.Number}",
+    " null"    -> s" ${Defines.Null}",
+    " string"  -> s" ${Defines.String}",
+    " boolean" -> s" ${Defines.Boolean}",
+    "{}"       -> Defines.Object,
     "typeof "  -> ""
   )
 
@@ -26,46 +26,46 @@ trait TypeHelper { this: AstCreator =>
   }
 
   private def typeForFlowType(flowType: BabelNodeInfo): String = flowType.node match {
-    case BooleanTypeAnnotation        => Defines.BOOLEAN
-    case NumberTypeAnnotation         => Defines.NUMBER
-    case ObjectTypeAnnotation         => Defines.OBJECT
-    case StringTypeAnnotation         => Defines.STRING
-    case SymbolTypeAnnotation         => Defines.SYMBOL
+    case BooleanTypeAnnotation        => Defines.Boolean
+    case NumberTypeAnnotation         => Defines.Number
+    case ObjectTypeAnnotation         => Defines.Object
+    case StringTypeAnnotation         => Defines.String
+    case SymbolTypeAnnotation         => Defines.Symbol
     case NumberLiteralTypeAnnotation  => code(flowType.json)
     case ArrayTypeAnnotation          => code(flowType.json)
     case BooleanLiteralTypeAnnotation => code(flowType.json)
     case NullLiteralTypeAnnotation    => code(flowType.json)
     case StringLiteralTypeAnnotation  => code(flowType.json)
     case GenericTypeAnnotation        => code(flowType.json("id"))
-    case ThisTypeAnnotation           => dynamicInstanceTypeStack.headOption.getOrElse(Defines.ANY)
-    case NullableTypeAnnotation       => typeForTypeAnnotation(createBabelNodeInfo(flowType.json(TYPE_ANNOTATION_KEY)))
-    case _                            => Defines.ANY
+    case ThisTypeAnnotation           => dynamicInstanceTypeStack.headOption.getOrElse(Defines.Any)
+    case NullableTypeAnnotation       => typeForTypeAnnotation(createBabelNodeInfo(flowType.json(TypeAnnotationKey)))
+    case _                            => Defines.Any
   }
 
   private def typeForTsType(tsType: BabelNodeInfo): String = tsType.node match {
-    case TSBooleanKeyword    => Defines.BOOLEAN
-    case TSBigIntKeyword     => Defines.NUMBER
-    case TSNullKeyword       => Defines.NULL
-    case TSNumberKeyword     => Defines.NUMBER
-    case TSObjectKeyword     => Defines.OBJECT
-    case TSStringKeyword     => Defines.STRING
-    case TSSymbolKeyword     => Defines.SYMBOL
+    case TSBooleanKeyword    => Defines.Boolean
+    case TSBigIntKeyword     => Defines.Number
+    case TSNullKeyword       => Defines.Null
+    case TSNumberKeyword     => Defines.Number
+    case TSObjectKeyword     => Defines.Object
+    case TSStringKeyword     => Defines.String
+    case TSSymbolKeyword     => Defines.Symbol
     case TSIntrinsicKeyword  => code(tsType.json)
     case TSTypeReference     => code(tsType.json)
     case TSArrayType         => code(tsType.json)
-    case TSThisType          => dynamicInstanceTypeStack.headOption.getOrElse(Defines.ANY)
-    case TSOptionalType      => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TYPE_ANNOTATION_KEY)))
-    case TSRestType          => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TYPE_ANNOTATION_KEY)))
-    case TSParenthesizedType => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TYPE_ANNOTATION_KEY)))
-    case _                   => Defines.ANY
+    case TSThisType          => dynamicInstanceTypeStack.headOption.getOrElse(Defines.Any)
+    case TSOptionalType      => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TypeAnnotationKey)))
+    case TSRestType          => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TypeAnnotationKey)))
+    case TSParenthesizedType => typeForTypeAnnotation(createBabelNodeInfo(tsType.json(TypeAnnotationKey)))
+    case _                   => Defines.Any
   }
 
   private def typeForTypeAnnotation(typeAnnotation: BabelNodeInfo): String = typeAnnotation.node match {
-    case TypeAnnotation   => typeForFlowType(createBabelNodeInfo(typeAnnotation.json(TYPE_ANNOTATION_KEY)))
-    case TSTypeAnnotation => typeForTsType(createBabelNodeInfo(typeAnnotation.json(TYPE_ANNOTATION_KEY)))
+    case TypeAnnotation   => typeForFlowType(createBabelNodeInfo(typeAnnotation.json(TypeAnnotationKey)))
+    case TSTypeAnnotation => typeForTsType(createBabelNodeInfo(typeAnnotation.json(TypeAnnotationKey)))
     case _: FlowType      => typeForFlowType(createBabelNodeInfo(typeAnnotation.json))
     case _: TSType        => typeForTsType(createBabelNodeInfo(typeAnnotation.json))
-    case _                => Defines.ANY
+    case _                => Defines.Any
   }
 
   private def isStringType(tpe: String): Boolean =
@@ -76,23 +76,23 @@ trait TypeHelper { this: AstCreator =>
 
   private def typeFromTypeMap(node: BabelNodeInfo): String =
     pos(node.json).flatMap(parserResult.typeMap.get) match {
-      case Some(value) if value.isEmpty       => Defines.STRING
-      case Some(value) if value == "string"   => Defines.STRING
-      case Some(value) if isStringType(value) => Defines.STRING
-      case Some(value) if value == "number"   => Defines.NUMBER
-      case Some(value) if isNumberType(value) => Defines.NUMBER
-      case Some(value) if value == "null"     => Defines.NULL
-      case Some(value) if value == "boolean"  => Defines.BOOLEAN
-      case Some(value) if value == "any"      => Defines.ANY
+      case Some(value) if value.isEmpty       => Defines.String
+      case Some(value) if value == "string"   => Defines.String
+      case Some(value) if isStringType(value) => Defines.String
+      case Some(value) if value == "number"   => Defines.Number
+      case Some(value) if isNumberType(value) => Defines.Number
+      case Some(value) if value == "null"     => Defines.Null
+      case Some(value) if value == "boolean"  => Defines.Boolean
+      case Some(value) if value == "any"      => Defines.Any
       case Some(other) =>
-        TYPE_REPLACEMENTS.foldLeft(other) { case (typeStr, (m, r)) =>
+        TypeReplacements.foldLeft(other) { case (typeStr, (m, r)) =>
           typeStr.replace(m, r)
         }
-      case None => Defines.ANY
+      case None => Defines.Any
     }
 
   protected def typeFor(node: BabelNodeInfo): String = {
-    val tpe = Seq(TYPE_ANNOTATION_KEY, RETURN_TYPE_KEY).find(hasKey(node.json, _)) match {
+    val tpe = Seq(TypeAnnotationKey, ReturnTypeKey).find(hasKey(node.json, _)) match {
       case Some(key) => typeForTypeAnnotation(createBabelNodeInfo(node.json(key)))
       case None      => typeFromTypeMap(node)
     }
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala
index 75b697fc3..849738e75 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala
@@ -2,10 +2,10 @@ package io.joern.jssrc2cpg.parser
 
 object BabelAst {
 
-  private val QUALIFIED_CLASS_NAME: String = BabelAst.getClass.getName
+  private val QualifiedClassName: String = BabelAst.getClass.getName
 
   def fromString(nodeName: String): BabelNode = {
-    val clazz = Class.forName(s"$QUALIFIED_CLASS_NAME$nodeName$$")
+    val clazz = Class.forName(s"$QualifiedClassName$nodeName$$")
     clazz.getField("MODULE$").get(clazz).asInstanceOf[BabelNode]
   }
 
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala
index 844326048..03cd327d6 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala
@@ -29,7 +29,7 @@ class AstCreationPass(cpg: Cpg, astGenRunnerResult: AstGenRunnerResult, config:
   override def generateParts(): Array[(String, String)] = astGenRunnerResult.parsedFiles.toArray
 
   def allUsedTypes(): List[(String, String)] =
-    usedTypes.keys().asScala.filterNot { case (typeName, _) => typeName == Defines.ANY }.toList
+    usedTypes.keys().asScala.filterNot { case (typeName, _) => typeName == Defines.Any }.toList
 
   override def finish(): Unit = {
     astGenRunnerResult.skippedFiles.foreach { skippedFile =>
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
index 5ac7eb882..e3aa66f25 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPass.scala
@@ -9,14 +9,14 @@ class BuiltinTypesPass(cpg: Cpg) extends CpgPass(cpg) {
 
   override def run(diffGraph: DiffGraphBuilder): Unit = {
     val namespaceBlock = NewNamespaceBlock()
-      .name(Defines.GLOBAL_NAMESPACE)
-      .fullName(Defines.GLOBAL_NAMESPACE)
+      .name(Defines.GlobalNamespace)
+      .fullName(Defines.GlobalNamespace)
       .order(0)
       .filename("builtintypes")
 
     diffGraph.addNode(namespaceBlock)
 
-    Defines.JSTYPES.zipWithIndex.map { case (typeName: String, index) =>
+    Defines.JsTypes.zipWithIndex.map { case (typeName: String, index) =>
       val tpe = NewType()
         .name(typeName)
         .fullName(typeName)
@@ -28,7 +28,7 @@ class BuiltinTypesPass(cpg: Cpg) extends CpgPass(cpg) {
         .fullName(typeName)
         .isExternal(true)
         .astParentType(NodeTypes.NAMESPACE_BLOCK)
-        .astParentFullName(Defines.GLOBAL_NAMESPACE)
+        .astParentFullName(Defines.GlobalNamespace)
         .order(index + 1)
         .filename("builtintypes")
 
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala
index ce6fb5a3d..f9a09c4ca 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala
@@ -27,7 +27,7 @@ class ConfigPass(cpg: Cpg, config: Config, report: Report = new Report()) extend
   protected def configFiles(config: Config, extensions: Set[String]): Seq[File] =
     SourceFiles
       .determine(config.inputPath, extensions)
-      .filterNot(_.contains(Defines.NODE_MODULES_FOLDER))
+      .filterNot(_.contains(Defines.NodeModulesFolder))
       .filter(f => selectedExtensions.exists(f.endsWith))
       .map(File(_))
 
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala
index 8dc4c4af9..441fc7de1 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala
@@ -3,17 +3,17 @@ package io.joern.jssrc2cpg.passes
 import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal
 
 object Defines {
-  val ANY: String                 = "ANY"
-  val NUMBER: String              = "__ecma.Number"
-  val STRING: String              = "__ecma.String"
-  val BOOLEAN: String             = "__ecma.Boolean"
-  val NULL: String                = "__ecma.Null"
-  val MATH: String                = "__ecma.Math"
-  val SYMBOL: String              = "__ecma.Symbol"
-  val CONSOLE: String             = "__whatwg.console"
-  val OBJECT: String              = "object"
-  val NODE_MODULES_FOLDER: String = "node_modules"
-  val GLOBAL_NAMESPACE: String    = NamespaceTraversal.globalNamespaceName
+  val Any: String               = "ANY"
+  val Number: String            = "__ecma.Number"
+  val String: String            = "__ecma.String"
+  val Boolean: String           = "__ecma.Boolean"
+  val Null: String              = "__ecma.Null"
+  val Math: String              = "__ecma.Math"
+  val Symbol: String            = "__ecma.Symbol"
+  val Console: String           = "__whatwg.console"
+  val Object: String            = "object"
+  val NodeModulesFolder: String = "node_modules"
+  val GlobalNamespace: String   = NamespaceTraversal.globalNamespaceName
 
-  val JSTYPES: List[String] = List(ANY, NUMBER, STRING, BOOLEAN, NULL, MATH, SYMBOL, CONSOLE, OBJECT)
+  val JsTypes: List[String] = List(Any, Number, String, Boolean, Null, Math, Symbol, Console, Object)
 }
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala
index 31cd30ca1..7ca5be6a1 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala
@@ -14,9 +14,9 @@ class DependenciesPass(cpg: Cpg, config: Config) extends CpgPass(cpg) {
   override def run(diffGraph: DiffGraphBuilder): Unit = {
     val packagesJsons = SourceFiles
       .determine(config.inputPath, Set(".json"))
-      .filterNot(_.contains(Defines.NODE_MODULES_FOLDER))
+      .filterNot(_.contains(Defines.NodeModulesFolder))
       .filter(f =>
-        f.endsWith(PackageJsonParser.PACKAGE_JSON_FILENAME) || f.endsWith(PackageJsonParser.PACKAGE_JSON_LOCK_FILENAME)
+        f.endsWith(PackageJsonParser.PackageJsonFilename) || f.endsWith(PackageJsonParser.PackageJsonLockFilename)
       )
 
     val dependencies: Map[String, String] =
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala
index bda113ef4..29f30a585 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala
@@ -11,7 +11,7 @@ import scala.util.matching.Regex
 class PrivateKeyFilePass(cpg: Cpg, config: Config, report: Report = new Report())
     extends ConfigPass(cpg, config, report) {
 
-  private val PRIVATE_KEY: Regex = """.*RSA\sPRIVATE\sKEY.*""".r
+  private val PrivateKeyRegex: Regex = """.*RSA\sPRIVATE\sKEY.*""".r
 
   override val allExtensions: Set[String]      = Set(".key")
   override val selectedExtensions: Set[String] = Set(".key")
@@ -21,7 +21,7 @@ class PrivateKeyFilePass(cpg: Cpg, config: Config, report: Report = new Report()
 
   override def generateParts(): Array[File] =
     configFiles(config, selectedExtensions).toArray.filter(p =>
-      IOUtils.readLinesInFile(p.path).exists(PRIVATE_KEY.matches)
+      IOUtils.readLinesInFile(p.path).exists(PrivateKeyRegex.matches)
     )
 
 }
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/RequirePass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/RequirePass.scala
index 00d6caf4b..13a30b9e6 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/RequirePass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/RequirePass.scala
@@ -1,6 +1,6 @@
 package io.joern.jssrc2cpg.passes
 
-import io.joern.jssrc2cpg.passes.RequirePass.JS_EXPORT_PREFIX
+import io.joern.jssrc2cpg.passes.RequirePass.JsExportPrefix
 import io.shiftleft.codepropertygraph.Cpg
 import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, Call, Local}
 import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames}
@@ -129,8 +129,8 @@ class RequirePass(cpg: Cpg) extends CpgPass(cpg) {
           diffGraph.setNodeProperty(
             n.node,
             if (varInfo.isImmutable) PropertyNames.TYPE_FULL_NAME else PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME,
-            if (varInfo.isImmutable) rs.map(x => s"$JS_EXPORT_PREFIX${x.relativeExport}").headOption.getOrElse("ANY")
-            else varInfo.dynamicTypeHintFullName ++ rs.map(x => s"$JS_EXPORT_PREFIX${x.relativeExport}")
+            if (varInfo.isImmutable) rs.map(x => s"$JsExportPrefix${x.relativeExport}").headOption.getOrElse("ANY")
+            else varInfo.dynamicTypeHintFullName ++ rs.map(x => s"$JsExportPrefix${x.relativeExport}")
           )
         }
       }
@@ -160,5 +160,5 @@ class RequirePass(cpg: Cpg) extends CpgPass(cpg) {
 }
 
 object RequirePass {
-  val JS_EXPORT_PREFIX: String = "<export>::"
+  val JsExportPrefix: String = "<export>::"
 }
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/TypeNodePass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/TypeNodePass.scala
index c4eade9c0..dc2964d3c 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/TypeNodePass.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/TypeNodePass.scala
@@ -7,7 +7,7 @@ import io.shiftleft.passes.CpgPass
 class TypeNodePass(usedTypes: List[(String, String)], cpg: Cpg) extends CpgPass(cpg, "types") {
   override def run(diffGraph: DiffGraphBuilder): Unit = {
     val filteredTypes = usedTypes.filterNot { case (name, _) =>
-      name == Defines.ANY || Defines.JSTYPES.contains(name)
+      name == Defines.Any || Defines.JsTypes.contains(name)
     }
 
     filteredTypes.sortBy(_._2).foreach { case (name, fullName) =>
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/preprocessing/EjsPreprocessor.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/preprocessing/EjsPreprocessor.scala
index 111570895..c1c09fd9c 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/preprocessing/EjsPreprocessor.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/preprocessing/EjsPreprocessor.scala
@@ -4,16 +4,16 @@ import scala.collection.mutable
 
 class EjsPreprocessor {
 
-  private val COMMENT_TAG         = "<%#"
-  private val TAG_GROUPS_REGEX    = """(<%[=\-_#]?)([\s\S]*?)([-_#]?%>)""".r
-  private val SCRIPT_GROUPS_REGEX = """(<script>)([\s\S]*?)(</script>)""".r
-  private val TAGS                = List("<%#", "<%=", "<%-", "<%_", "-%>", "_%>", "#%>", "%>")
+  private val CommentTag        = "<%#"
+  private val TagGroupsRegex    = """(<%[=\-_#]?)([\s\S]*?)([-_#]?%>)""".r
+  private val ScriptGroupsRegex = """(<script>)([\s\S]*?)(</script>)""".r
+  private val Tags              = List("<%#", "<%=", "<%-", "<%_", "-%>", "_%>", "#%>", "%>")
 
   private def stripScriptTag(code: String): String = {
     var x = code.replaceAll("<script>", "<%      ").replaceAll("</script>", "%>       ")
-    SCRIPT_GROUPS_REGEX.findAllIn(code).matchData.foreach { ma =>
+    ScriptGroupsRegex.findAllIn(code).matchData.foreach { ma =>
       var scriptBlock = ma.group(2)
-      TAGS.foreach { tag =>
+      Tags.foreach { tag =>
         scriptBlock = scriptBlock.replaceAll(tag, " " * tag.length)
       }
       x = x.replace(ma.group(2), scriptBlock)
@@ -28,10 +28,10 @@ class EjsPreprocessor {
     val codeWithoutScriptTag = stripScriptTag(code)
     val codeAsCharArray      = codeWithoutScriptTag.toCharArray
     val preprocessedCode     = new mutable.StringBuilder(codeAsCharArray.length)
-    val matches              = TAG_GROUPS_REGEX.findAllIn(codeWithoutScriptTag).matchData.toList
+    val matches              = TagGroupsRegex.findAllIn(codeWithoutScriptTag).matchData.toList
 
     val positions = matches.flatMap {
-      case ma if ma.group(1) == COMMENT_TAG              => None // ignore comments
+      case ma if ma.group(1) == CommentTag               => None // ignore comments
       case ma if ma.group(2).trim.startsWith("include ") => None // ignore including other ejs templates
       case ma =>
         val start = ma.start + ma.group(1).length
@@ -51,7 +51,7 @@ class EjsPreprocessor {
     var codeWithoutSemicolon = preprocessedCode.toString()
     val alreadyReplaced      = mutable.ArrayBuffer.empty[(Int, Int)]
     matches.foreach {
-      case ma if ma.group(1) == COMMENT_TAG              => // ignore comments
+      case ma if ma.group(1) == CommentTag               => // ignore comments
       case ma if ma.group(2).trim.startsWith("include ") => // ignore including other ejs templates
       case ma if needsSemicolon(ma.group(2)) =>
         val start = ma.start + ma.group(1).length
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala
index ceac28a2e..632066855 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala
@@ -27,16 +27,16 @@ class AstGenRunner(config: Config) {
 
   private val logger = LoggerFactory.getLogger(getClass)
 
-  private val LINE_LENGTH_THRESHOLD: Int = 10000
+  private val LineLengthThreshold: Int = 10000
 
-  private val TYPE_DEFINITION_FILE_EXTENSIONS = List(".t.ts.json", ".d.ts.json")
+  private val TypeDefinitionFileExtensions = List(".t.ts.json", ".d.ts.json")
 
-  private val MINIFIED_PATH_REGEX: Regex = ".*([.-]min\\..*js|bundle\\.js)".r
+  private val MinifiedPathRegex: Regex = ".*([.-]min\\..*js|bundle\\.js)".r
 
-  private val IGNORED_TESTS_REGEX: Seq[Regex] =
+  private val IgnoredTestsRegex: Seq[Regex] =
     List(".*[.-]spec\\.js".r, ".*[.-]mock\\.js".r, ".*[.-]e2e\\.js".r, ".*[.-]test\\.js".r)
 
-  private val IGNORED_FILES_REGEX: Seq[Regex] = List(
+  private val IgnoredFilesRegex: Seq[Regex] = List(
     ".*jest\\.config.*".r,
     ".*webpack\\..*\\.js".r,
     ".*vue\\.config\\.js".r,
@@ -54,21 +54,26 @@ class AstGenRunner(config: Config) {
     ".*eslint-local-rules\\.js".r
   )
 
-  private val EXECUTABLE_ARGS = if (!config.tsTypes) {
+  private val ExecutableArgs = if (!config.tsTypes) {
     " --no-tsTypes"
   } else {
     ""
   }
 
-  private val EXECUTABLE_NAME = if (Environment.IS_MAC) {
-    "astgen-macos"
-  } else if (Environment.IS_LINUX) {
-    "astgen-linux"
-  } else {
-    "astgen-win.exe"
+  private val ExecutableName = Environment.OperatingSystem match {
+    case Environment.OperatingSystemType.Windows => "astgen-win.exe"
+    case Environment.OperatingSystemType.Linux   => "astgen-linux"
+    case Environment.OperatingSystemType.Mac =>
+      Environment.Architecture match {
+        case Environment.ArchitectureType.X86 => "astgen-macos"
+        case Environment.ArchitectureType.ARM => "astgen-macos-arm"
+      }
+    case Environment.OperatingSystemType.Unknown =>
+      logger.warn("Could not detect OS version! Defaulting to 'Linux'.")
+      "astgen-linux"
   }
 
-  private val EXECUTABLE_DIR: String = {
+  private val ExecutableDir: String = {
     val dir        = getClass.getProtectionDomain.getCodeSource.getLocation.toString
     val indexOfLib = dir.lastIndexOf("lib")
     val fixedDir = if (indexOfLib != -1) {
@@ -114,12 +119,12 @@ class AstGenRunner(config: Config) {
   }
 
   private def isMinifiedFile(filePath: String): Boolean = filePath match {
-    case p if MINIFIED_PATH_REGEX.matches(p) => true
+    case p if MinifiedPathRegex.matches(p) => true
     case p if File(p).exists && p.endsWith(".js") =>
       val lines             = IOUtils.readLinesInFile(File(filePath).path)
       val linesOfCode       = lines.size
       val longestLineLength = if (lines.isEmpty) 0 else lines.map(_.length).max
-      if (longestLineLength >= LINE_LENGTH_THRESHOLD && linesOfCode <= 50) {
+      if (longestLineLength >= LineLengthThreshold && linesOfCode <= 50) {
         logger.debug(s"'$filePath' seems to be a minified file (contains a line with length $longestLineLength)")
         true
       } else false
@@ -128,8 +133,8 @@ class AstGenRunner(config: Config) {
 
   private def isIgnoredByDefault(filePath: String, config: Config, out: File): Boolean = {
     val resolvedFilePath   = filePath.stripSuffix(".json").replace(out.pathAsString, config.inputPath)
-    lazy val isIgnored     = IGNORED_FILES_REGEX.exists(_.matches(resolvedFilePath))
-    lazy val isIgnoredTest = IGNORED_TESTS_REGEX.exists(_.matches(resolvedFilePath))
+    lazy val isIgnored     = IgnoredFilesRegex.exists(_.matches(resolvedFilePath))
+    lazy val isIgnoredTest = IgnoredTestsRegex.exists(_.matches(resolvedFilePath))
     lazy val isMinified    = isMinifiedFile(resolvedFilePath)
     if (isIgnored || isIgnoredTest || isMinified) {
       logger.debug(s"'$resolvedFilePath' ignored by default")
@@ -144,10 +149,10 @@ class AstGenRunner(config: Config) {
       // We are not interested in JS / TS type definition files at this stage.
       // TODO: maybe we can enable that later on and use the type definitions there
       //  for enhancing the CPG with additional type information for functions
-      case filePath if TYPE_DEFINITION_FILE_EXTENSIONS.exists(filePath.endsWith) => false
-      case filePath if isIgnoredByUserConfig(filePath, config, out)              => false
-      case filePath if isIgnoredByDefault(filePath, config, out)                 => false
-      case _                                                                     => true
+      case filePath if TypeDefinitionFileExtensions.exists(filePath.endsWith) => false
+      case filePath if isIgnoredByUserConfig(filePath, config, out)           => false
+      case filePath if isIgnoredByDefault(filePath, config, out)              => false
+      case _                                                                  => true
     }
   }
 
@@ -164,7 +169,7 @@ class AstGenRunner(config: Config) {
       jsFile
     }
 
-    val result = ExternalCommand.run(s"$EXECUTABLE_DIR/$EXECUTABLE_NAME$EXECUTABLE_ARGS -t ts -o $out", out.toString())
+    val result = ExternalCommand.run(s"$ExecutableDir/$ExecutableName$ExecutableArgs -t ts -o $out", out.toString())
 
     val jsons = SourceFiles.determine(out.toString(), Set(".json"))
     jsons.foreach { jsonPath =>
@@ -190,12 +195,12 @@ class AstGenRunner(config: Config) {
   private def vueFiles(in: File, out: File): Try[Seq[String]] = {
     val files = SourceFiles.determine(in.pathAsString, Set(".vue"))
     if (files.nonEmpty)
-      ExternalCommand.run(s"$EXECUTABLE_DIR/$EXECUTABLE_NAME$EXECUTABLE_ARGS -t vue -o $out", in.toString())
+      ExternalCommand.run(s"$ExecutableDir/$ExecutableName$ExecutableArgs -t vue -o $out", in.toString())
     else Success(Seq.empty)
   }
 
   private def jsFiles(in: File, out: File): Try[Seq[String]] =
-    ExternalCommand.run(s"$EXECUTABLE_DIR/$EXECUTABLE_NAME$EXECUTABLE_ARGS -t ts -o $out", in.toString())
+    ExternalCommand.run(s"$ExecutableDir/$ExecutableName$ExecutableArgs -t ts -o $out", in.toString())
 
   private def runAstGenNative(in: File, out: File): Try[Seq[String]] = for {
     ejsResult <- ejsFiles(in, out)
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/Environment.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/Environment.scala
index 912972b3a..b2c565696 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/Environment.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/Environment.scala
@@ -5,8 +5,29 @@ import java.nio.file.Paths
 
 object Environment {
 
-  val IS_MAC: Boolean   = scala.util.Properties.isMac
-  val IS_LINUX: Boolean = scala.util.Properties.isLinux
+  object OperatingSystemType extends Enumeration {
+    type OperatingSystem = Value
+
+    val Windows, Linux, Mac, Unknown = Value
+  }
+
+  object ArchitectureType extends Enumeration {
+    type Architecture = Value
+
+    val X86, ARM = Value
+  }
+
+  val OperatingSystem: OperatingSystemType.OperatingSystem =
+    if (scala.util.Properties.isMac) OperatingSystemType.Mac
+    else if (scala.util.Properties.isLinux) OperatingSystemType.Linux
+    else if (scala.util.Properties.isWin) OperatingSystemType.Windows
+    else OperatingSystemType.Unknown
+
+  val Architecture: ArchitectureType.Architecture =
+    if (scala.util.Properties.propOrNone("os.arch").contains("aarch64")) ArchitectureType.ARM
+    // We do not distinguish between x86 and x64. E.g, a 64 bit Windows will always lie about
+    // this and will report x86 anyway for backwards compatibility with 32 bit software.
+    else ArchitectureType.X86
 
   private val logger = LoggerFactory.getLogger(getClass)
 
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/PackageJsonParser.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/PackageJsonParser.scala
index cfd7f2e7a..0051c3028 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/PackageJsonParser.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/PackageJsonParser.scala
@@ -15,16 +15,16 @@ import scala.util.Success
 object PackageJsonParser {
   private val logger = LoggerFactory.getLogger(PackageJsonParser.getClass)
 
-  val PACKAGE_JSON_FILENAME      = "package.json"
-  val PACKAGE_JSON_LOCK_FILENAME = "package-lock.json"
+  val PackageJsonFilename     = "package.json"
+  val PackageJsonLockFilename = "package-lock.json"
 
-  private val projectDependencies =
+  private val ProjectDependencies =
     Seq("dependencies", "devDependencies", "peerDependencies", "optionalDependencies")
 
   private val cachedDependencies: TrieMap[Path, Map[String, String]] = TrieMap.empty
 
   def isValidProjectPackageJson(packageJsonPath: Path): Boolean = {
-    if (packageJsonPath.toString.endsWith(PackageJsonParser.PACKAGE_JSON_FILENAME)) {
+    if (packageJsonPath.toString.endsWith(PackageJsonParser.PackageJsonFilename)) {
       val isNotEmpty = Try(IOUtils.readLinesInFile(packageJsonPath)) match {
         case Success(content) =>
           content.forall(l => StringUtils.isNotBlank(StringUtils.normalizeSpace(l)))
@@ -40,7 +40,7 @@ object PackageJsonParser {
     cachedDependencies.getOrElseUpdate(
       packageJsonPath, {
         val depsPath     = packageJsonPath
-        val lockDepsPath = packageJsonPath.resolveSibling(Paths.get(PACKAGE_JSON_LOCK_FILENAME))
+        val lockDepsPath = packageJsonPath.resolveSibling(Paths.get(PackageJsonLockFilename))
 
         val lockDeps = Try {
           val content      = IOUtils.readLinesInFile(lockDepsPath).mkString("\n")
@@ -68,7 +68,7 @@ object PackageJsonParser {
           val packageJson  = objectMapper.readTree(content)
 
           var depToVersion = Map.empty[String, String]
-          projectDependencies
+          ProjectDependencies
             .foreach { dependency =>
               val dependencyIt = Option(packageJson.get(dependency))
                 .map(_.fields().asScala)
@@ -89,7 +89,7 @@ object PackageJsonParser {
             deps.get
           } else {
             logger.debug(
-              s"No project dependencies found in $PACKAGE_JSON_FILENAME or $PACKAGE_JSON_LOCK_FILENAME at '${depsPath.getParent}'."
+              s"No project dependencies found in $PackageJsonFilename or $PackageJsonLockFilename at '${depsPath.getParent}'."
             )
             Map.empty
           }


Test patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
index 85b312548..dc1865809 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/BuiltinTypesPassTest.scala
@@ -10,11 +10,11 @@ class BuiltinTypesPassTest extends AbstractPassTest {
     new BuiltinTypesPass(cpg).createAndApply()
 
     "create a '<global>' NamespaceBlock" in {
-      cpg.namespaceBlock.name.l shouldBe List(Defines.GLOBAL_NAMESPACE)
+      cpg.namespaceBlock.name.l shouldBe List(Defines.GlobalNamespace)
     }
 
     "create types and type decls correctly" in {
-      Defines.JSTYPES.foreach { (typeName: String) =>
+      Defines.JsTypes.foreach { (typeName: String) =>
         val List(typeDeclNode) = cpg.typeDecl(typeName).l
         typeDeclNode.fullName shouldBe typeName
         typeDeclNode.isExternal shouldBe true
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTest.scala
index ba6d95c45..ed06337aa 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTest.scala
@@ -65,7 +65,7 @@ class ConfigPassTest extends AnyWordSpec with Matchers {
         fileC.write("c")
 
         // should be ignored
-        val d = (dir / Defines.NODE_MODULES_FOLDER).createDirectory()
+        val d = (dir / Defines.NodeModulesFolder).createDirectory()
         (d / "d.json").write("d")
 
         val cpg = Cpg.emptyCpg
@@ -125,7 +125,7 @@ class ConfigPassTest extends AnyWordSpec with Matchers {
 
     "ignore ConfigFiles correctly" in {
       File.usingTemporaryDirectory("jssrc2cpgTest") { dir =>
-        val d     = (dir / Defines.NODE_MODULES_FOLDER).createDirectory()
+        val d     = (dir / Defines.NodeModulesFolder).createDirectory()
         val fileA = d / "a.key"
         fileA.write("-----BEGIN RSA PRIVATE KEY-----\n123456789\n-----END RSA PRIVATE KEY-----")
 
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTest.scala
index 9790b56e4..47f18ebfd 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTest.scala
@@ -13,7 +13,7 @@ class DependenciesPassTest extends AbstractPassTest {
 
     "ignore empty package.json" in {
       File.usingTemporaryDirectory("jssrc2cpgTest") { dir =>
-        val json = dir / PackageJsonParser.PACKAGE_JSON_FILENAME
+        val json = dir / PackageJsonParser.PackageJsonFilename
         json.write("")
         PackageJsonParser.isValidProjectPackageJson(json.path) shouldBe false
       }
@@ -21,7 +21,7 @@ class DependenciesPassTest extends AbstractPassTest {
 
     "ignore package.json without any useful content" in {
       File.usingTemporaryDirectory("jssrc2cpgTest") { dir =>
-        val json = dir / PackageJsonParser.PACKAGE_JSON_FILENAME
+        val json = dir / PackageJsonParser.PackageJsonFilename
         json.write("""
             |{
             |  "name": "something",
@@ -37,7 +37,7 @@ class DependenciesPassTest extends AbstractPassTest {
 
     "ignore package.json without dependencies" in {
       File.usingTemporaryDirectory("jssrc2cpgTest") { dir =>
-        val json = dir / PackageJsonParser.PACKAGE_JSON_FILENAME
+        val json = dir / PackageJsonParser.PackageJsonFilename
         json.write("{}")
         PackageJsonParser.isValidProjectPackageJson(json.path) shouldBe false
       }
@@ -73,7 +73,7 @@ class DependenciesPassTest extends AbstractPassTest {
           |  }
           |}
           |""".stripMargin,
-      packageJsonName = PackageJsonParser.PACKAGE_JSON_LOCK_FILENAME
+      packageJsonName = PackageJsonParser.PackageJsonLockFilename
     ) { cpg =>
       val List(depA, depB) = cpg.dependency.l
       depA.name shouldBe "dep1"
@@ -133,7 +133,7 @@ class DependenciesPassTest extends AbstractPassTest {
     def apply(
       code: String,
       packageJsonContent: String,
-      packageJsonName: String = PackageJsonParser.PACKAGE_JSON_FILENAME
+      packageJsonName: String = PackageJsonParser.PackageJsonFilename
     )(f: Cpg => Unit): Unit = {
       File.usingTemporaryDirectory("jssrc2cpgTest") { dir =>
         val file = dir / "file.js"
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
index b17a40024..71c1b4fc5 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
@@ -39,9 +39,9 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
 
     "have correct type for literals" in AstFixture("let x = 1; let y = 'y'; let z = false;") { cpg =>
       val List(x, y, z) = cpg.literal.l
-      x.typeFullName shouldBe Defines.NUMBER
-      y.typeFullName shouldBe Defines.STRING
-      z.typeFullName shouldBe Defines.BOOLEAN
+      x.typeFullName shouldBe Defines.Number
+      y.typeFullName shouldBe Defines.String
+      z.typeFullName shouldBe Defines.Boolean
     }
 
     "have correct structure for multiple declarators in one place" in AstFixture("let x = 1, y = 2, z = 3;") { cpg =>
@@ -415,8 +415,8 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
       file.name should endWith("code.js")
 
       val List(ns) = cpg.namespaceBlock.l
-      ns.name shouldBe Defines.GLOBAL_NAMESPACE
-      ns.fullName should endWith("code.js:" + Defines.GLOBAL_NAMESPACE)
+      ns.name shouldBe Defines.GlobalNamespace
+      ns.fullName should endWith("code.js:" + Defines.GlobalNamespace)
       ns.order shouldBe 1
       ns.filename shouldBe file.name
     }
@@ -426,8 +426,8 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
       file.name should endWith("code.js")
 
       val List(ns) = cpg.namespaceBlock.l
-      ns.name shouldBe Defines.GLOBAL_NAMESPACE
-      ns.fullName should endWith("code.js:" + Defines.GLOBAL_NAMESPACE)
+      ns.name shouldBe Defines.GlobalNamespace
+      ns.fullName should endWith("code.js:" + Defines.GlobalNamespace)
       ns.order shouldBe 1
       ns.method.head.name shouldBe ":program"
     }
@@ -728,8 +728,8 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
     "have correct structure for empty method" in AstFixture("function method(x) {}") { cpg =>
       val List(method) = cpg.method.nameExact("method").l
       method.astChildren.isBlock.size shouldBe 1
-      method.parameter.index(0).nameExact("this").typeFullName(Defines.ANY).size shouldBe 1
-      method.parameter.index(1).nameExact("x").typeFullName(Defines.ANY).size shouldBe 1
+      method.parameter.index(0).nameExact("this").typeFullName(Defines.Any).size shouldBe 1
+      method.parameter.index(1).nameExact("x").typeFullName(Defines.Any).size shouldBe 1
     }
 
     "have correct structure for empty method with rest parameter" in AstFixture("function method(x, ...args) {}") {
@@ -738,15 +738,15 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
         val List(t, x, args) = method.parameter.l
         t.index shouldBe 0
         t.name shouldBe "this"
-        t.typeFullName shouldBe Defines.ANY
+        t.typeFullName shouldBe Defines.Any
         x.index shouldBe 1
         x.name shouldBe "x"
-        x.typeFullName shouldBe Defines.ANY
+        x.typeFullName shouldBe Defines.Any
         args.index shouldBe 2
         args.name shouldBe "args"
         args.code shouldBe "...args"
         args.isVariadic shouldBe true
-        args.typeFullName shouldBe Defines.ANY
+        args.typeFullName shouldBe Defines.Any
     }
 
     "have correct structure for decl assignment" in AstFixture("function foo(x) { var local = 1; }") { cpg =>
@@ -756,10 +756,10 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
       val List(t, x) = method.parameter.l
       t.index shouldBe 0
       t.name shouldBe "this"
-      t.typeFullName shouldBe Defines.ANY
+      t.typeFullName shouldBe Defines.Any
       x.index shouldBe 1
       x.name shouldBe "x"
-      x.typeFullName shouldBe Defines.ANY
+      x.typeFullName shouldBe Defines.Any
 
       val List(local) = block.astChildren.isLocal.l
       local.name shouldBe "local"
@@ -778,10 +778,10 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
       val List(t, x) = method.parameter.l
       t.index shouldBe 0
       t.name shouldBe "this"
-      t.typeFullName shouldBe Defines.ANY
+      t.typeFullName shouldBe Defines.Any
       x.index shouldBe 1
       x.name shouldBe "x"
-      x.typeFullName shouldBe Defines.ANY
+      x.typeFullName shouldBe Defines.Any
 
       val List(local) = block.astChildren.isLocal.l
       local.name shouldBe "local"
@@ -801,13 +801,13 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
       val List(t, x, y) = method.parameter.l
       t.index shouldBe 0
       t.name shouldBe "this"
-      t.typeFullName shouldBe Defines.ANY
+      t.typeFullName shouldBe Defines.Any
       x.index shouldBe 1
       x.name shouldBe "x"
-      x.typeFullName shouldBe Defines.ANY
+      x.typeFullName shouldBe Defines.Any
       y.index shouldBe 2
       y.name shouldBe "y"
-      y.typeFullName shouldBe Defines.ANY
+      y.typeFullName shouldBe Defines.Any
 
       val List(firstLocal, secondLocal) = block.astChildren.isLocal.l
       firstLocal.name shouldBe "local1"
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTest.scala
index 3815cf343..085a0e2b8 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTest.scala
@@ -52,7 +52,7 @@ class TsAstCreationPassTest extends AbstractPassTest {
         func.fullName shouldBe "code.ts::program:foo"
         val List(_, arg) = cpg.method("foo").parameter.l
         arg.name shouldBe "arg"
-        arg.typeFullName shouldBe Defines.STRING
+        arg.typeFullName shouldBe Defines.String
         arg.code shouldBe "arg: string"
         arg.index shouldBe 1
         val List(parentTypeDecl) = cpg.typeDecl.name(":program").l
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTest.scala
index bb7191532..8482b074c 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTest.scala
@@ -17,22 +17,22 @@ class TSTypesTest extends AbstractPassTest {
     val List(t, x, args) = method.parameter.l
     t.index shouldBe 0
     t.name shouldBe "this"
-    t.typeFullName shouldBe Defines.ANY
+    t.typeFullName shouldBe Defines.Any
     x.index shouldBe 1
     x.name shouldBe "x"
-    x.typeFullName shouldBe Defines.ANY
+    x.typeFullName shouldBe Defines.Any
     args.index shouldBe 2
     args.name shouldBe "args"
     args.code shouldBe "...args"
     args.isVariadic shouldBe true
-    args.typeFullName shouldBe Defines.ANY
+    args.typeFullName shouldBe Defines.Any
   }
 
   "have return types for arrow functions" in AstFixture("const foo = () => 42;", tsTypes = true) { cpg =>
     val List(foo) = cpg.identifier("foo").l
-    foo.typeFullName shouldBe s"() => ${Defines.NUMBER}"
+    foo.typeFullName shouldBe s"() => ${Defines.Number}"
     val List(ret) = cpg.method("anonymous").methodReturn.l
-    ret.typeFullName shouldBe Defines.NUMBER
+    ret.typeFullName shouldBe Defines.Number
   }
 
   "have correct types for empty method" in AstFixture("function method(x) {}", tsTypes = true) { cpg =>
@@ -48,7 +48,7 @@ class TSTypesTest extends AbstractPassTest {
     tsTypes = true
   ) { cpg =>
     val List(y) = cpg.identifier("y").l
-    y.typeFullName shouldBe Defines.STRING
+    y.typeFullName shouldBe Defines.String
   }
 
   "have types for identifiers from class" in AstFixture(
@@ -76,9 +76,9 @@ class TSTypesTest extends AbstractPassTest {
     y1.typeFullName shouldBe "Foo"
     y2.typeFullName shouldBe "Foo"
     val List(p1) = cpg.parameter("p1").l
-    p1.typeFullName shouldBe Defines.NUMBER
+    p1.typeFullName shouldBe Defines.Number
     val List(p2) = cpg.parameter("p2").l
-    p2.typeFullName shouldBe Defines.STRING
+    p2.typeFullName shouldBe Defines.String
     val List(barRet) = cpg.method("bar").methodReturn.l
     barRet.typeFullName shouldBe "Foo"
     cpg.typ.name.sorted.l shouldBe (List(
@@ -86,7 +86,7 @@ class TSTypesTest extends AbstractPassTest {
       io.joern.x2cpg.Defines.ConstructorMethodName,
       "Foo",
       "bar"
-    ) ++ Defines.JSTYPES).sorted
+    ) ++ Defines.JsTypes).sorted
   }
 
   "have correct types for variables" in TsAstFixture(
@@ -99,7 +99,7 @@ class TSTypesTest extends AbstractPassTest {
     inside(cpg.identifier.l) { case List(x, y) =>
       x.name shouldBe "x"
       x.code shouldBe "x"
-      x.typeFullName shouldBe Defines.STRING
+      x.typeFullName shouldBe Defines.String
       y.name shouldBe "y"
       y.code shouldBe "y"
       y.typeFullName shouldBe "Foo"
@@ -117,7 +117,7 @@ class TSTypesTest extends AbstractPassTest {
     inside(cpg.identifier.l) { case List(x) =>
       x.name shouldBe "x"
       x.code shouldBe "x"
-      x.typeFullName shouldBe Defines.STRING // we can actually follow type intrinsics
+      x.typeFullName shouldBe Defines.String // we can actually follow type intrinsics
     }
   }
 
@@ -130,7 +130,7 @@ class TSTypesTest extends AbstractPassTest {
     inside(cpg.method("foo").parameter.l) { case List(_, a, b) =>
       a.name shouldBe "a"
       a.code shouldBe "a: string"
-      a.typeFullName shouldBe Defines.STRING
+      a.typeFullName shouldBe Defines.String
       b.name shouldBe "b"
       b.code shouldBe "b: Foo"
       b.typeFullName shouldBe "Foo"
@@ -226,7 +226,7 @@ class TSTypesTest extends AbstractPassTest {
     tsTypes = true
   ) { cpg =>
     cpg.typeDecl("string").l shouldBe empty
-    cpg.typeDecl(Defines.STRING).size shouldBe 1
+    cpg.typeDecl(Defines.String).size shouldBe 1
     inside(cpg.typeDecl("Alias").l) { case List(alias) =>
       alias.fullName shouldBe "code.ts::program:Alias"
       alias.code shouldBe "type Alias = string"
@@ -251,12 +251,12 @@ class TSTypesTest extends AbstractPassTest {
       callZ.argument(1).code shouldBe "boolean"
       callZ.argument(2).code shouldBe "true"
     }
-    cpg.local("x").typeFullName.l shouldBe List(Defines.STRING)
-    cpg.identifier("x").typeFullName.l shouldBe List(Defines.STRING)
+    cpg.local("x").typeFullName.l shouldBe List(Defines.String)
+    cpg.identifier("x").typeFullName.l shouldBe List(Defines.String)
     cpg.local("y").typeFullName.l shouldBe List("int")
     cpg.identifier("y").typeFullName.l shouldBe List("int")
-    cpg.local("z").typeFullName.l shouldBe List(Defines.BOOLEAN)
-    cpg.identifier("z").typeFullName.l shouldBe List(Defines.BOOLEAN)
+    cpg.local("z").typeFullName.l shouldBe List(Defines.Boolean)
+    cpg.identifier("z").typeFullName.l shouldBe List(Defines.Boolean)
   }
 
   "have correct types when type is being used multiple times" in TsAstFixture(
@@ -323,7 +323,7 @@ class TSTypesTest extends AbstractPassTest {
     tsTypes = true
   ) { cpg =>
     val List(x) = cpg.identifier("x").l
-    x.typeFullName shouldBe Defines.STRING
+    x.typeFullName shouldBe Defines.String
   }
 
 }