Skip to content

Commit c069370

Browse files
author
DKravtsov
committed
testing SARIF report
1 parent 0bc19f0 commit c069370

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Test latest PHPCPD release
6565
run: php ./releases/phpcpd-9.1.0.phar --log-sarif=reports/phpcpd/phpcpd-report.sarif src tests
6666
- name: Upload SARIF report to GitHub
67-
uses: github/codeql-action/upload-sarif@v3
67+
uses: github/codeql-action/upload-sarif@v4
6868
if: always()
6969
with:
7070
sarif_file: reports/phpcpd/phpcpd-report.sarif

‎tests/Fixture/Math.php‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,65 @@ public function complex($v1, $v2)
274274

275275
return $v8;
276276
}
277+
278+
public function div($v1, $v2)
279+
{
280+
$v3 = $v1 / ($v2 + $v1);
281+
if ($v3 > 14)
282+
{
283+
$v4 = 0;
284+
for ($i = 0; $i < $v3; $i++)
285+
{
286+
$v4 += ($v2 * $i);
287+
}
288+
}
289+
$v5 = ($v4 < $v3 ? ($v3 - $v4) : ($v4 - $v3));
290+
291+
$v6 = ($v1 * $v2 * $v3 * $v4 * $v5);
292+
293+
$d = array($v1, $v2, $v3, $v4, $v5, $v6);
294+
295+
$v7 = 1;
296+
for ($i = 0; $i < $v6; $i++)
297+
{
298+
shuffle( $d );
299+
$v7 = $v7 + $i * end($d);
300+
}
301+
302+
$v8 = $v7;
303+
foreach ( $d as $x )
304+
{
305+
$v8 *= $x;
306+
}
307+
308+
$v3 = $v1 / ($v2 + $v1);
309+
if ($v3 > 14)
310+
{
311+
$v4 = 0;
312+
for ($i = 0; $i < $v3; $i++)
313+
{
314+
$v4 += ($v2 * $i);
315+
}
316+
}
317+
$v5 = ($v4 < $v3 ? ($v3 - $v4) : ($v4 - $v3));
318+
319+
$v6 = ($v1 * $v2 * $v3 * $v4 * $v5);
320+
321+
$d = array($v1, $v2, $v3, $v4, $v5, $v6);
322+
323+
$v7 = 1;
324+
for ($i = 0; $i < $v6; $i++)
325+
{
326+
shuffle( $d );
327+
$v7 = $v7 + $i * end($d);
328+
}
329+
330+
$v8 = $v7;
331+
foreach ( $d as $x )
332+
{
333+
$v8 *= $x;
334+
}
335+
336+
return $v8;
337+
}
277338
}

0 commit comments

Comments
 (0)