Dataflow: Make default field flow branch limit configurable per language

This commit is contained in:
Jeroen Ketema
2025-04-24 10:58:02 +02:00
parent 4093afbaab
commit 46b21af3ef

View File

@@ -342,6 +342,9 @@ signature module InputSig<LocationSig Location> {
any() any()
} }
/** Gets the default value for the `fieldFlowBranchLimit` */
default int defaultFieldFlowBranchLimit() { result = 2 }
/** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */ /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */
default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() } default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() }
} }
@@ -399,7 +402,7 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
* This can be overridden to a smaller value to improve performance (a * This can be overridden to a smaller value to improve performance (a
* value of 0 disables field flow), or a larger value to get more results. * value of 0 disables field flow), or a larger value to get more results.
*/ */
default int fieldFlowBranchLimit() { result = 2 } default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() }
/** Gets the access path limit. */ /** Gets the access path limit. */
default int accessPathLimit() { result = Lang::accessPathLimit() } default int accessPathLimit() { result = Lang::accessPathLimit() }
@@ -548,7 +551,7 @@ module Configs<LocationSig Location, InputSig<Location> Lang> {
* This can be overridden to a smaller value to improve performance (a * This can be overridden to a smaller value to improve performance (a
* value of 0 disables field flow), or a larger value to get more results. * value of 0 disables field flow), or a larger value to get more results.
*/ */
default int fieldFlowBranchLimit() { result = 2 } default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() }
/** Gets the access path limit. */ /** Gets the access path limit. */
default int accessPathLimit() { result = Lang::accessPathLimit() } default int accessPathLimit() { result = Lang::accessPathLimit() }