Skip to content

Commit 7ec6444

Browse files
committed
Shared and Sync: Fix some Ql4Ql violations.
1 parent b4d6cb6 commit 7ec6444

File tree

7 files changed

+39
-40
lines changed

7 files changed

+39
-40
lines changed

javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModelsExtensions.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Holds if the value at `(type, path)` should be seen as a flow
7-
* source of the given `kind`.
7+
* source of the given `kind`. The `madId` is the data extension row number.
88
*
99
* The kind `remote` represents a general remote flow source.
1010
*/
@@ -14,13 +14,13 @@ extensible predicate sourceModel(
1414

1515
/**
1616
* Holds if the value at `(type, path)` should be seen as a sink
17-
* of the given `kind`.
17+
* of the given `kind`. The `madId` is the data extension row number.
1818
*/
1919
extensible predicate sinkModel(string type, string path, string kind, QlBuiltins::ExtensionId madId);
2020

2121
/**
2222
* Holds if in calls to `(type, path)`, the value referred to by `input`
23-
* can flow to the value referred to by `output`.
23+
* can flow to the value referred to by `output`. The `madId` is the data extension row number.
2424
*
2525
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
2626
* respectively.

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsExtensions.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Holds if the value at `(type, path)` should be seen as a flow
7-
* source of the given `kind`.
7+
* source of the given `kind`. The `madId` is the data extension row number.
88
*
99
* The kind `remote` represents a general remote flow source.
1010
*/
@@ -14,13 +14,13 @@ extensible predicate sourceModel(
1414

1515
/**
1616
* Holds if the value at `(type, path)` should be seen as a sink
17-
* of the given `kind`.
17+
* of the given `kind`. The `madId` is the data extension row number.
1818
*/
1919
extensible predicate sinkModel(string type, string path, string kind, QlBuiltins::ExtensionId madId);
2020

2121
/**
2222
* Holds if in calls to `(type, path)`, the value referred to by `input`
23-
* can flow to the value referred to by `output`.
23+
* can flow to the value referred to by `output`. The `madId` is the data extension row number.
2424
*
2525
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
2626
* respectively.

ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModelsExtensions.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Holds if the value at `(type, path)` should be seen as a flow
7-
* source of the given `kind`.
7+
* source of the given `kind`. The `madId` is the data extension row number.
88
*
99
* The kind `remote` represents a general remote flow source.
1010
*/
@@ -14,13 +14,13 @@ extensible predicate sourceModel(
1414

1515
/**
1616
* Holds if the value at `(type, path)` should be seen as a sink
17-
* of the given `kind`.
17+
* of the given `kind`. The `madId` is the data extension row number.
1818
*/
1919
extensible predicate sinkModel(string type, string path, string kind, QlBuiltins::ExtensionId madId);
2020

2121
/**
2222
* Holds if in calls to `(type, path)`, the value referred to by `input`
23-
* can flow to the value referred to by `output`.
23+
* can flow to the value referred to by `output`. The `madId` is the data extension row number.
2424
*
2525
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
2626
* respectively.

shared/dataflow/codeql/dataflow/DataFlow.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
695695
* Constructs a global data flow computation.
696696
*/
697697
module Global<ConfigSig Config> implements GlobalFlowSig {
698-
private module C implements FullStateConfigSig {
698+
private module StateConfig implements FullStateConfigSig {
699699
import DefaultState<Config>
700700
import Config
701701

@@ -706,11 +706,11 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
706706
}
707707
}
708708

709-
private module Stage1 = ImplStage1<C>;
709+
private module Stage1 = ImplStage1<StateConfig>;
710710

711711
import Stage1::PartialFlow
712712

713-
private module Flow = Impl<C, Stage1::Stage1NoState>;
713+
private module Flow = Impl<StateConfig, Stage1::Stage1NoState>;
714714

715715
import Flow
716716
}
@@ -719,7 +719,7 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
719719
* Constructs a global data flow computation using flow state.
720720
*/
721721
module GlobalWithState<StateConfigSig Config> implements GlobalFlowSig {
722-
private module C implements FullStateConfigSig {
722+
private module StateConfig implements FullStateConfigSig {
723723
import Config
724724

725725
predicate accessPathLimit = Config::accessPathLimit/0;
@@ -735,11 +735,11 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
735735
}
736736
}
737737

738-
private module Stage1 = ImplStage1<C>;
738+
private module Stage1 = ImplStage1<StateConfig>;
739739

740740
import Stage1::PartialFlow
741741

742-
private module Flow = Impl<C, Stage1::Stage1WithState>;
742+
private module Flow = Impl<StateConfig, Stage1::Stage1WithState>;
743743

744744
import Flow
745745
}

shared/dataflow/codeql/dataflow/TaintTracking.qll

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module TaintFlowMake<
5656
private import MakeImpl<Location, DataFlowLang> as DataFlowInternal
5757
private import MakeImplStage1<Location, DataFlowLang> as DataFlowInternalStage1
5858

59-
private module AddTaintDefaults<DataFlowInternal::FullStateConfigSig Config> implements
59+
private module MakeAddTaintDefaultsConfig<DataFlowInternal::FullStateConfigSig Config> implements
6060
DataFlowInternal::FullStateConfigSig
6161
{
6262
import Config
@@ -98,15 +98,15 @@ module TaintFlowMake<
9898
}
9999
}
100100

101-
private module C implements DataFlowInternal::FullStateConfigSig {
102-
import AddTaintDefaults<Config0>
101+
private module AddTaintDefaultsConfig implements DataFlowInternal::FullStateConfigSig {
102+
import MakeAddTaintDefaultsConfig<Config0>
103103
}
104104

105-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
105+
private module Stage1 = DataFlowInternalStage1::ImplStage1<AddTaintDefaultsConfig>;
106106

107107
import Stage1::PartialFlow
108108

109-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1NoState>;
109+
private module Flow = DataFlowInternal::Impl<AddTaintDefaultsConfig, Stage1::Stage1NoState>;
110110

111111
import Flow
112112
}
@@ -132,15 +132,15 @@ module TaintFlowMake<
132132
}
133133
}
134134

135-
private module C implements DataFlowInternal::FullStateConfigSig {
136-
import AddTaintDefaults<Config0>
135+
private module AddTaintDefaultsConfig implements DataFlowInternal::FullStateConfigSig {
136+
import MakeAddTaintDefaultsConfig<Config0>
137137
}
138138

139-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
139+
private module Stage1 = DataFlowInternalStage1::ImplStage1<AddTaintDefaultsConfig>;
140140

141141
import Stage1::PartialFlow
142142

143-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1WithState>;
143+
private module Flow = DataFlowInternal::Impl<AddTaintDefaultsConfig, Stage1::Stage1WithState>;
144144

145145
import Flow
146146
}
@@ -234,15 +234,15 @@ module TaintFlowMake<
234234
}
235235
}
236236

237-
private module C implements DataFlowInternal::FullStateConfigSig {
238-
import AddTaintDefaults<AddSpeculativeTaintSteps<Config0, speculationLimit/0>>
237+
private module AddTaintDefaultsConfig implements DataFlowInternal::FullStateConfigSig {
238+
import MakeAddTaintDefaultsConfig<AddSpeculativeTaintSteps<Config0, speculationLimit/0>>
239239
}
240240

241-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
241+
private module Stage1 = DataFlowInternalStage1::ImplStage1<AddTaintDefaultsConfig>;
242242

243243
import Stage1::PartialFlow
244244

245-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1WithState>;
245+
private module Flow = DataFlowInternal::Impl<AddTaintDefaultsConfig, Stage1::Stage1WithState>;
246246

247247
import Flow
248248
}
@@ -272,15 +272,15 @@ module TaintFlowMake<
272272
}
273273
}
274274

275-
private module C implements DataFlowInternal::FullStateConfigSig {
276-
import AddTaintDefaults<AddSpeculativeTaintSteps<Config0, speculationLimit/0>>
275+
private module AddTaintDefaultsConfig implements DataFlowInternal::FullStateConfigSig {
276+
import MakeAddTaintDefaultsConfig<AddSpeculativeTaintSteps<Config0, speculationLimit/0>>
277277
}
278278

279-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
279+
private module Stage1 = DataFlowInternalStage1::ImplStage1<AddTaintDefaultsConfig>;
280280

281281
import Stage1::PartialFlow
282282

283-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1WithState>;
283+
private module Flow = DataFlowInternal::Impl<AddTaintDefaultsConfig, Stage1::Stage1WithState>;
284284

285285
import Flow
286286
}

shared/quantum/codeql/quantum/experimental/Model.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
365365
*/
366366
abstract class ArtifactConsumer extends ConsumerElement {
367367
/**
368-
* Use `getAKnownArtifactSource() instead. The behaviour of these two predicates is equivalent.
368+
* Use `getAKnownArtifactSource() instead. The behavior of these two predicates is equivalent.
369369
*/
370370
final override KnownElement getAKnownSource() { result = this.getAKnownArtifactSource() }
371371

@@ -1841,9 +1841,7 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
18411841
* An SCRYPT key derivation algorithm node.
18421842
*/
18431843
class ScryptAlgorithmNode extends KeyDerivationAlgorithmNode {
1844-
ScryptAlgorithmInstance scryptInstance;
1845-
1846-
ScryptAlgorithmNode() { scryptInstance = instance.asAlg() }
1844+
ScryptAlgorithmNode() { instance.asAlg() instanceof ScryptAlgorithmInstance }
18471845

18481846
/**
18491847
* Gets the iteration count (`N`) argument

shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,11 @@ module RangeStage<
784784
else
785785
if strictlyNegativeIntegralExpr(x)
786786
then upper = false and delta = D::fromInt(1)
787-
else
788-
if semNegative(x)
789-
then upper = false and delta = D::fromInt(0)
790-
else none()
787+
else (
788+
semNegative(x) and
789+
upper = false and
790+
delta = D::fromInt(0)
791+
)
791792
)
792793
or
793794
e2.(Sem::RemExpr).getRightOperand() = e1 and

0 commit comments

Comments
 (0)