No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
37c14b9
... +0 ...
dfae066
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
415 | 415 | * to be the for-loop's body... Same goes for while loops. |
|
416 | 416 | * I'm going to double that semicolon (if any) so after the next line, |
|
417 | 417 | * which strips semicolons here & there, we're still left with this one. |
|
418 | + | * Note the special recursive construct in the three inner parts of the for: |
|
419 | + | * (\{([^\{\}]*(?-2))*[^\{\}]*\})? - it is intended to match inline |
|
420 | + | * functions bodies, e.g.: i<arr.map(function(e){return e}).length. |
|
421 | + | * Also note that the construct is applied only once and multiplied |
|
422 | + | * for each part of the for, otherwise it risks a catastrophic backtracking. |
|
423 | + | * The limitation is that it will not allow closures in more than one |
|
424 | + | * of the three parts for a specific for() case. |
|
425 | + | * REGEX throwing catastrophic backtracking: $content = preg_replace('/(for\([^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*\));(\}|$)/s', '\\1;;\\8', $content); |
|
418 | 426 | */ |
|
419 | - | $content = preg_replace('/(for\([^;\{]*;[^;\{]*;[^;\{]*\));(\}|$)/s', '\\1;;\\2', $content); |
|
427 | + | $content = preg_replace('/(for\([^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*;[^;\{]*\));(\}|$)/s', '\\1;;\\4', $content); |
|
428 | + | $content = preg_replace('/(for\([^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*;[^;\{]*\));(\}|$)/s', '\\1;;\\4', $content); |
|
429 | + | $content = preg_replace('/(for\([^;\{]*;[^;\{]*;[^;\{]*(\{([^\{\}]*(?-2))*[^\{\}]*\})?[^;\{]*\));(\}|$)/s', '\\1;;\\4', $content); |
|
430 | + | ||
420 | 431 | $content = preg_replace('/(for\([^;\{]+\s+in\s+[^;\{]+\));(\}|$)/s', '\\1;;\\2', $content); |
|
421 | 432 | /* |
|
422 | 433 | * Below will also keep `;` after a `do{}while();` along with `while();` |
Files | Complexity | Coverage |
---|---|---|
src | ø | +<.01% 99.56% |
Project Totals (3 files) | 118 | 99.56% |
dfae066
37c14b9