We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

Duplicate Literals Removal

Potency
2 / 3
Resilience
3 / 5
Cost
1 / 5

Tags: duplicate,literal,removal,elimination,optimization,obfuscation

Description

Duplicate Literals Removal replaces duplicate literals with a variable name.

Example

Consider the following example:

1
2
var foo = "http://www.example.xyz";
bar("http://www.example.xyz");

All occurrences of the string literal "http://www.example.xyz" have been replaced
with a single variable name.

1
2
3
var a = "http://www.example.xyz";
var foo = a;
bar(a);

Option Types

Name Required Default Value Description
mode No [] If set to “optimization”, the transformation will only take action when replacing is worth, meaning that if the result would become bigger the transformation is not applied.

API Parameters

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "duplicateLiteralsRemoval",
"options": {
"mode": []
}
}
]
}