aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2022-10-26 16:17:06 +0200
committersonartech <sonartech@sonarsource.com>2022-10-26 20:03:10 +0000
commitdc592db7bb160b5c43fae1fcfd7e222ed0c875a1 (patch)
tree70715bcd8c0432c19edceb3f9ba523fcb9117ee0 /sonar-core
parentd4c9abe2a0a04d6a974c12d6ad06a17eb1ace4a8 (diff)
downloadsonarqube-dc592db7bb160b5c43fae1fcfd7e222ed0c875a1.tar.gz
sonarqube-dc592db7bb160b5c43fae1fcfd7e222ed0c875a1.zip
SONAR-11096 Discard files from analysis scope greater 20MB
SONAR-11096 Discard files from analysis scope greater when than 20 MB - introduce property 'sonar.filesize.limit'
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java11
-rw-r--r--sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java2
2 files changed, 11 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java b/sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java
index fa38ca14887..6b9ede6192f 100644
--- a/sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java
+++ b/sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java
@@ -26,6 +26,7 @@ import org.sonar.api.resources.Qualifiers;
import static java.util.Arrays.asList;
import static org.sonar.api.PropertyType.BOOLEAN;
+import static org.sonar.api.PropertyType.INTEGER;
public class ScannerProperties {
@@ -38,7 +39,7 @@ public class ScannerProperties {
public static final String PULL_REQUEST_KEY = "sonar.pullrequest.key";
public static final String PULL_REQUEST_BRANCH = "sonar.pullrequest.branch";
public static final String PULL_REQUEST_BASE = "sonar.pullrequest.base";
-
+ public static final String FILE_SIZE_LIMIT = "sonar.filesize.limit";
public static final String LINKS_SOURCES_DEV = "sonar.links.scm_dev";
public static final String DISABLE_PROJECT_AND_ORG_AUTODETECTION = "sonar.keys_autodetection.disabled";
@@ -84,6 +85,14 @@ public class ScannerProperties {
.description("Disables auto-detection of project keys from scanner execution environment.")
.type(BOOLEAN)
.hidden()
+ .build(),
+ PropertyDefinition.builder(FILE_SIZE_LIMIT)
+ .name("Limit of a file size excluded from analysis in MB")
+ .type(INTEGER)
+ .defaultValue("20")
+ .description(
+ "Allows discarding files from analysis exceeding certain sizes.")
+ .hidden()
.build());
}
}
diff --git a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
index 00d1068c7a3..fada8ca9c48 100644
--- a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
@@ -30,7 +30,7 @@ public class CorePropertyDefinitionsTest {
@Test
public void all() {
List<PropertyDefinition> defs = CorePropertyDefinitions.all();
- assertThat(defs).hasSize(52);
+ assertThat(defs).hasSize(53);
}
@Test