@@ -12,38 +12,28 @@ private import Shared
1212 * An additional source specified in an `additional-sources.csv` file.
1313 */
1414class AdditionalSourceSpec extends ExternalData {
15- AdditionalSourceSpec ( ) {
16- this .getDataPath ( ) = "additional-sources.csv"
17- }
15+ AdditionalSourceSpec ( ) { this .getDataPath ( ) = "additional-sources.csv" }
1816
1917 /**
2018 * Gets the portal of this additional source.
2119 */
22- Portal getPortal ( ) {
23- result .toString ( ) = getField ( 0 )
24- }
20+ Portal getPortal ( ) { result .toString ( ) = getField ( 0 ) }
2521
2622 /**
2723 * Gets the flow label of this source.
2824 */
29- DataFlow:: FlowLabel getFlowLabel ( ) {
30- sourceFlowLabelSpec ( result , getField ( 1 ) )
31- }
25+ DataFlow:: FlowLabel getFlowLabel ( ) { sourceFlowLabelSpec ( result , getField ( 1 ) ) }
3226
3327 /**
3428 * Gets the configuration for which this is a source, or any
3529 * configuration if this source does not specify a configuration.
3630 */
37- DataFlow:: Configuration getConfiguration ( ) {
38- configSpec ( result , getField ( 2 ) )
39- }
31+ DataFlow:: Configuration getConfiguration ( ) { configSpec ( result , getField ( 2 ) ) }
4032
4133 override string toString ( ) {
42- exists ( string config |
43- if getField ( 2 ) = "" then
44- config = "any configuration"
45- else
46- config = getConfiguration ( ) |
34+ exists ( string config |
35+ if getField ( 2 ) = "" then config = "any configuration" else config = getConfiguration ( )
36+ |
4737 result = getPortal ( ) + " as " + getFlowLabel ( ) + " source for " + config
4838 )
4939 }
@@ -52,9 +42,7 @@ class AdditionalSourceSpec extends ExternalData {
5242private class AdditionalSourceFromSpec extends DataFlow:: AdditionalSource {
5343 AdditionalSourceSpec spec ;
5444
55- AdditionalSourceFromSpec ( ) {
56- this = spec .getPortal ( ) .getAnExitNode ( _)
57- }
45+ AdditionalSourceFromSpec ( ) { this = spec .getPortal ( ) .getAnExitNode ( _) }
5846
5947 override predicate isSourceFor ( DataFlow:: Configuration cfg , DataFlow:: FlowLabel lbl ) {
6048 cfg = spec .getConfiguration ( ) and lbl = spec .getFlowLabel ( )
@@ -65,40 +53,30 @@ private class AdditionalSourceFromSpec extends DataFlow::AdditionalSource {
6553 * An additional sink specified in an `additional-sinks.csv` file.
6654 */
6755class AdditionalSinkSpec extends ExternalData {
68- AdditionalSinkSpec ( ) {
69- this .getDataPath ( ) = "additional-sinks.csv"
70- }
56+ AdditionalSinkSpec ( ) { this .getDataPath ( ) = "additional-sinks.csv" }
7157
7258 /**
7359 * Gets the portal specification of this additional sink.
7460 */
75- Portal getPortal ( ) {
76- result .toString ( ) = getField ( 0 )
77- }
61+ Portal getPortal ( ) { result .toString ( ) = getField ( 0 ) }
7862
7963 /**
8064 * Gets the flow label of this sink, or any standard flow label if this sink
8165 * does not specify a flow label.
8266 */
83- DataFlow:: FlowLabel getFlowLabel ( ) {
84- sinkFlowLabelSpec ( result , getField ( 1 ) )
85- }
67+ DataFlow:: FlowLabel getFlowLabel ( ) { sinkFlowLabelSpec ( result , getField ( 1 ) ) }
8668
8769 /**
8870 * Gets the configuration for which this is a sink, or any configuration if
8971 * this sink does not specify a configuration.
9072 */
91- DataFlow:: Configuration getConfiguration ( ) {
92- configSpec ( result , getField ( 2 ) )
93- }
73+ DataFlow:: Configuration getConfiguration ( ) { configSpec ( result , getField ( 2 ) ) }
9474
9575 override string toString ( ) {
96- exists ( string labels , string config |
76+ exists ( string labels , string config |
9777 labels = strictconcat ( getFlowLabel ( ) , " or " ) and
98- if getField ( 2 ) = "" then
99- config = "any configuration"
100- else
101- config = getConfiguration ( ) |
78+ if getField ( 2 ) = "" then config = "any configuration" else config = getConfiguration ( )
79+ |
10280 result = getPortal ( ) + " as " + labels + " sink for " + config
10381 )
10482 }
@@ -107,73 +85,59 @@ class AdditionalSinkSpec extends ExternalData {
10785private class AdditionalSinkFromSpec extends DataFlow:: AdditionalSink {
10886 AdditionalSinkSpec spec ;
10987
110- AdditionalSinkFromSpec ( ) {
111- this = spec .getPortal ( ) .getAnEntryNode ( _)
112- }
88+ AdditionalSinkFromSpec ( ) { this = spec .getPortal ( ) .getAnEntryNode ( _) }
11389
11490 override predicate isSinkFor ( DataFlow:: Configuration cfg , DataFlow:: FlowLabel lbl ) {
11591 cfg = spec .getConfiguration ( ) and lbl = spec .getFlowLabel ( )
11692 }
11793}
94+
11895/**
11996 * An additional flow step specified in an `additional-steps.csv` file.
12097 */
12198class AdditionalStepSpec extends ExternalData {
122- AdditionalStepSpec ( ) {
123- this .getDataPath ( ) = "additional-steps.csv"
124- }
99+ AdditionalStepSpec ( ) { this .getDataPath ( ) = "additional-steps.csv" }
125100
126101 /**
127102 * Gets the start portal of this additional step.
128103 */
129- Portal getStartPortal ( ) {
130- result .toString ( ) = getField ( 0 )
131- }
104+ Portal getStartPortal ( ) { result .toString ( ) = getField ( 0 ) }
132105
133106 /**
134107 * Gets the start flow label of this additional step.
135108 */
136- DataFlow:: FlowLabel getStartFlowLabel ( ) {
137- result .toString ( ) = getField ( 1 )
138- }
109+ DataFlow:: FlowLabel getStartFlowLabel ( ) { result .toString ( ) = getField ( 1 ) }
139110
140111 /**
141112 * Gets the end portal of this additional step.
142113 */
143- Portal getEndPortal ( ) {
144- result .toString ( ) = getField ( 2 )
145- }
114+ Portal getEndPortal ( ) { result .toString ( ) = getField ( 2 ) }
146115
147116 /**
148117 * Gets the end flow label of this additional step.
149118 */
150- DataFlow:: FlowLabel getEndFlowLabel ( ) {
151- result .toString ( ) = getField ( 3 )
152- }
119+ DataFlow:: FlowLabel getEndFlowLabel ( ) { result .toString ( ) = getField ( 3 ) }
153120
154121 /**
155122 * Gets the configuration to which this step should be added.
156123 */
157- DataFlow:: Configuration getConfiguration ( ) {
158- configSpec ( result , getField ( 4 ) )
159- }
124+ DataFlow:: Configuration getConfiguration ( ) { configSpec ( result , getField ( 4 ) ) }
160125
161126 override string toString ( ) {
162- exists ( string config |
163- if getField ( 4 ) = "" then
164- config = "any configuration"
165- else
166- config = getConfiguration ( ) |
167- result = "edge from " + getStartPortal ( ) + " to " + getEndPortal ( ) +
168- ", transforming " + getStartFlowLabel ( ) + " into " + getEndFlowLabel ( ) +
169- " for " + config
127+ exists ( string config |
128+ if getField ( 4 ) = "" then config = "any configuration" else config = getConfiguration ( )
129+ |
130+ result = "edge from " + getStartPortal ( ) + " to " + getEndPortal ( ) + ", transforming " +
131+ getStartFlowLabel ( ) + " into " + getEndFlowLabel ( ) + " for " + config
170132 )
171133 }
172134}
173135
174136private class AdditionalFlowStepFromSpec extends DataFlow:: Configuration {
175137 AdditionalStepSpec spec ;
138+
176139 DataFlow:: Node entry ;
140+
177141 DataFlow:: Node exit ;
178142
179143 AdditionalFlowStepFromSpec ( ) {
@@ -182,8 +146,10 @@ private class AdditionalFlowStepFromSpec extends DataFlow::Configuration {
182146 exit = spec .getEndPortal ( ) .getAnExitNode ( _)
183147 }
184148
185- override predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ,
186- DataFlow:: FlowLabel predlbl , DataFlow:: FlowLabel succlbl ) {
149+ override predicate isAdditionalFlowStep (
150+ DataFlow:: Node pred , DataFlow:: Node succ , DataFlow:: FlowLabel predlbl ,
151+ DataFlow:: FlowLabel succlbl
152+ ) {
187153 pred = entry and
188154 succ = exit and
189155 predlbl = spec .getStartFlowLabel ( ) and
0 commit comments