1- _ This document was generated from '[ src/documentation/wiki-linter.ts] ( https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-linter.ts ) ' on 2026-01-03, 16:58:45 UTC presenting an overview of flowR's linter (v2.7.6 ). Please do not edit this file/wiki page directly._
1+ _ This document was generated from '[ src/documentation/wiki-linter.ts] ( https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-linter.ts ) ' on 2026-01-22, 13:24:22 UTC presenting an overview of flowR's linter (v2.8.9 ). Please do not edit this file/wiki page directly._
22<h2 id =" dead-code " >Dead Code&emsp ; <sup >[<a href =" https://github.com/flowr-analysis/flowr/wiki/Linter " >overview</a >]</sup ></h2 >
33
44<span title =" This rule is used to detect issues that do not directly affect the semantics of the code, but are still considered bad practice. " ><a href =' #smell ' >![ smell] ( https://img.shields.io/badge/smell-yellow ) </a ></span > <span title =" This rule is used to detect issues that are related to the reproducibility of the code. For example, missing or incorrect random seeds, or missing data. " ><a href =' #reproducibility ' >![ reproducibility] ( https://img.shields.io/badge/reproducibility-teal ) </a ></span > <span title =" This rule is used to detect issues that are related to the (re-)usability of the code. For example, missing or incorrect error handling, or missing or incorrect user interface elements. " ><a href =' #usability ' >![ usability] ( https://img.shields.io/badge/usability-teal ) </a ></span >
@@ -41,16 +41,16 @@ The linting query can be used to run this rule on the above example:
4141
4242_ Results (prettified and summarized):_
4343
44- Query: ** linter** (0 ms)\
44+ Query: ** linter** (1 ms)\
4545  ;  ;  ; ╰ ** Dead Code** (dead-code):\
4646  ;  ;  ;  ;  ;  ;  ; ╰ certain:\
4747  ;  ;  ;  ;  ;  ;  ;  ;  ;  ;  ; ╰ Code at 1.17\
48-   ;  ;  ;  ;  ;  ;  ; ╰ _ Metadata_ : <code >consideredNodes: 7, searchTimeMs: 0 , processTimeMs: 0</code >\
49- _ All queries together required ≈0 ms (1ms accuracy, total 2 ms)_
48+   ;  ;  ;  ;  ;  ;  ; ╰ _ Metadata_ : <code >consideredNodes: 7, searchTimeMs: 1 , processTimeMs: 0</code >\
49+ _ All queries together required ≈1 ms (1ms accuracy, total 1 ms)_
5050
5151<details > <summary style =" color :gray " >Show Detailed Results as Json</summary >
5252
53- The analysis required _ 2.1 ms_ (including parsing and normalization and the query) within the generation environment.
53+ The analysis required _ 0.7 ms_ (including parsing and normalization and the query) within the generation environment.
5454
5555In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
5656Please consult the [ Interface] ( https://github.com/flowr-analysis/flowr/wiki/Interface ) wiki page for more information on how to get those.
@@ -76,17 +76,17 @@ Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Inte
7676 ],
7777 ".meta" : {
7878 "consideredNodes" : 7 ,
79- "searchTimeMs" : 0 ,
79+ "searchTimeMs" : 1 ,
8080 "processTimeMs" : 0
8181 }
8282 }
8383 },
8484 ".meta" : {
85- "timing" : 0
85+ "timing" : 1
8686 }
8787 },
8888 ".meta" : {
89- "timing" : 0
89+ "timing" : 1
9090 }
9191}
9292```
@@ -225,13 +225,101 @@ if(TRUE) 1; stopifnot(FALSE); 2
225225We expect the linter to report the following:
226226
227227``` ts
228- certainty : LintingResultCertainty .Certain , range : [1 , 13 , 1 , 28 ] },
229- { certainty : LintingResultCertainty .Certain , range : [1 , 31 , 1 , 31 ] },
228+ certainty : LintingResultCertainty .Certain , range : [1 , 31 , 1 , 31 ] },
230229```
231230
232231
233232See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L23 ) for the test-case implementation.
234233
234+ <h4 id =" Test_Case:_stop_condition " >Test Case: stop condition</h4 >
235+
236+
237+ Given the following input:
238+
239+ ``` r
240+ `
241+ x <- 2
242+
243+ if (u ) {
244+ stop(42 )
245+ x <- 3
246+ }
247+
248+ print(2 )
249+ `
250+ ```
251+
252+
253+
254+ We expect the linter to report the following:
255+
256+ ``` ts
257+ certainty : LintingResultCertainty .Certain , range : [6 , 3 , 6 , 8 ]
258+ ```
259+
260+
261+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L26 ) for the test-case implementation.
262+
263+ <h4 id =" Test_Case:_return " >Test Case: return</h4 >
264+
265+
266+ Given the following input:
267+
268+ ``` r
269+ return (); 2
270+ ```
271+
272+
273+
274+ We expect the linter to report the following:
275+
276+ ``` ts
277+ certainty : LintingResultCertainty .Certain , range : [1 ,11 ,1 ,11 ]
278+ ```
279+
280+
281+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L38 ) for the test-case implementation.
282+
283+ <h4 id =" Test_Case:_try " >Test Case: try</h4 >
284+
285+
286+ Given the following input:
287+
288+ ``` r
289+ try(stop(1 )); 2
290+ ```
291+
292+
293+
294+ We expect the linter to report the following:
295+
296+ ``` ts
297+ * no lints
298+ ```
299+
300+
301+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L41 ) for the test-case implementation.
302+
303+ <h4 id =" Test_Case:_try_complex " >Test Case: try complex</h4 >
304+
305+
306+ Given the following input:
307+
308+ ``` r
309+ f <- function () { try(stop(1 )); 2 }; f(); stop(1 ); 2
310+ ```
311+
312+
313+
314+ We expect the linter to report the following:
315+
316+ ``` ts
317+ certainty : LintingResultCertainty .Certain , range : [1 , 52 , 1 , 52 ]
318+ ```
319+
320+
321+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L42 ) for the test-case implementation.
322+
235323<h4 id =" Test_Case:_always " >Test Case: always</h4 >
236324
237325
@@ -250,7 +338,7 @@ We expect the linter to report the following:
250338```
251339
252340
253- See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L30 ) for the test-case implementation.
341+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L48 ) for the test-case implementation.
254342
255343<h4 id =" Test_Case:_never " >Test Case: never</h4 >
256344
@@ -270,7 +358,7 @@ We expect the linter to report the following:
270358```
271359
272360
273- See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L33 ) for the test-case implementation.
361+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L51 ) for the test-case implementation.
274362
275363<h4 id =" Test_Case:_TRUE_FALSE " >Test Case: TRUE FALSE</h4 >
276364
@@ -290,7 +378,7 @@ We expect the linter to report the following:
290378```
291379
292380
293- See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L39 ) for the test-case implementation.
381+ See [ here] ( https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L57 ) for the test-case implementation.
294382
295383<h4 id =" Test_Case:_FALSE_FALSE " >Test Case: FALSE FALSE</h4 >
296384
@@ -311,7 +399,7 @@ We expect the linter to report the following:
311399` ` `
312400
313401
314- See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L42 ) for the test-case implementation.
402+ See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L60 ) for the test-case implementation.
315403
316404<h4 id="Test_Case:_FALSE_TRUE">Test Case: FALSE TRUE</h4>
317405
@@ -332,7 +420,7 @@ We expect the linter to report the following:
332420` ` `
333421
334422
335- See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L46 ) for the test-case implementation.
423+ See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L64 ) for the test-case implementation.
336424
337425<h4 id="Test_Case:_after_infinite_repeat">Test Case: after infinite repeat</h4>
338426
@@ -352,7 +440,7 @@ We expect the linter to report the following:
352440` ` `
353441
354442
355- See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L53 ) for the test-case implementation.
443+ See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L71 ) for the test-case implementation.
356444
357445<h4 id="Test_Case:_after_infinite_while">Test Case: after infinite while</h4>
358446
@@ -372,4 +460,4 @@ We expect the linter to report the following:
372460` ` `
373461
374462
375- See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L56 ) for the test-case implementation.
463+ See [here](https://github.com/flowr-analysis/flowr/tree/main//test/functionality/linter/lint-dead-code.test.ts#L74 ) for the test-case implementation.
0 commit comments