@@ -58,13 +58,6 @@ describe("Rule: no-spread", () => {
58
58
export const apple = Juice.D31
59
59
export const banana = Juice.D32
60
60
export const cat = Juice.D33
61
- ` ,
62
- `
63
- export namespace Constants {
64
- export const defaultDebounceTimeRegular_s: u32 = SendTime.NEXT_REGULAR
65
- export const debounceTimeGnssInnerCity_s = SendTime.S30
66
- export const debounceTimeGnssMotorway_s = SendTime.S120
67
- }
68
61
` ,
69
62
/**
70
63
* WARN: should NOT extract [] elements as they can get modified easily
@@ -81,12 +74,6 @@ export namespace Constants {
81
74
data[0][1].count++;
82
75
send(data[0][1].id);
83
76
` ,
84
- `
85
- const a = dataset[0][1].x + dataset[0][1].y;
86
- dataset[0][1].update();
87
- const b = dataset[0][1].z * 2;
88
- notify(dataset[0][1].timestamp);
89
- ` ,
90
77
// WARN: DONT extract when function with possible side effect is called upon
91
78
`
92
79
const a = data.x + data.y;
@@ -95,77 +82,10 @@ export namespace Constants {
95
82
notify(data.x);
96
83
` ,
97
84
`
98
- const first = data.items[0].config['security'].rules[2].level;
99
- data.items[0].config['security'].rules[2].enabled = true;
100
- validate(data.items[0].config['security'].rules[2].level);
101
- ` ,
102
- `
103
85
const v1 = obj[123].value;
104
86
const v2 = obj[123].value;
105
87
const v3 = obj[123].value;
106
88
` ,
107
- // some more complex cases
108
- `
109
-
110
- /**
111
- * Distance-based emission strategy
112
- */
113
- export class DistanceBasedDeliveryStrategy implements EmissionStrategy {
114
- private checkStateChange(attr: NumericProperty): bool {
115
- return (
116
- attr.getCurrent().isUnstable() &&
117
- attr.getPrevious() != null &&
118
- attr.getPrevious()!.isStable()
119
- );
120
- }
121
-
122
- public isEqual(other: GenericValueContainer<i32>): bool {
123
- return (
124
- this.isStable() == other.isStable() &&
125
- this.isActive() == other.isActive() &&
126
- (!this.isActive() || this.getValue() == other.getValue())
127
- );
128
- }
129
-
130
- public copy(): GenericValueContainer<i64> {
131
- const clone = new LongValueWrapper(this.initializer);
132
- clone.status = this.status;
133
- clone.error = this.error;
134
- return clone;
135
- }
136
- }` ,
137
- `
138
-
139
- let activeConfig: BaseConfiguration;
140
- const configData = AppContext.loadSettings();
141
-
142
- if (configData) {
143
- activeConfig = configData;
144
- } else {
145
- activeConfig = new BaseConfiguration();
146
- activeConfig.initializationDelay = Constants.DEFAULT_INIT_DELAY;
147
- activeConfig.fastPollingInterval = Constants.DEFAULT_FAST_INTERVAL;
148
- activeConfig.normalPollingInterval = Constants.DEFAULT_NORMAL_INTERVAL;
149
- }
150
-
151
- if (runtimeEnv && eventController) {
152
- SystemHookManager.instance = this;
153
- this.eventController = eventController;
154
- runtimeEnv.registerStateChangeListener(SystemHookManager.handleStateChange);
155
- this.lastKnownState = runtimeEnv.getCurrentEnvironmentState();
156
- }
157
- ` ,
158
- `
159
- if (
160
- currentSession.authType == AuthType.PRIVILEGED &&
161
- currentSession.status == SessionStatus.ACTIVE &&
162
- this.runtimeEnv.getCurrentEnvironmentState().isPresent()
163
- ) {
164
- const timestamp = getTimestamp();
165
- serviceInstance.lastSyncTime = timestamp;
166
- }
167
-
168
- ` ,
169
89
// shouldn't report when modified
170
90
`
171
91
const v1 = a.b.c;
@@ -179,12 +99,6 @@ export namespace Constants {
179
99
const v2 = a.b.c;
180
100
const v3 = a.b.c;
181
101
` ,
182
- `
183
- this.vehicleSys!.automobile = new TransportCore(new TransportBlueprint());
184
- this.vehicleSys!.automobile!.underframe = new ChassisAssembly(new ChassisSchema());
185
- this.vehicleSys!.automobile!.underframe!.propulsionCover = new EngineEnclosure(new EnclosureSpec());
186
- this.vehicleSys!.automobile!.underframe!.logisticsBay = new CargoModule(new ModuleTemplate());
187
- ` ,
188
102
] ,
189
103
190
104
invalid : [
0 commit comments