|
| 1 | +<!DOCTYPE HTML SYSTEM "about:legacy-compat"> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 | +<meta charset="utf-8"> |
| 6 | +<link href=" https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel=" stylesheet" integrity=" sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin=" anonymous" > |
| 7 | +<script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script> |
| 8 | +<link href="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.13.4/b-2.3.6/b-html5-2.3.6/b-print-2.3.6/datatables.min.css" rel="stylesheet"> |
| 9 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script><script src="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.13.4/b-2.3.6/b-html5-2.3.6/b-print-2.3.6/datatables.min.js"></script> |
| 10 | +<title>PHPCPD Report</title> |
| 11 | +<link rel="icon" href="https://systemsdk.github.io/images/favicon.ico" sizes="32x32"> |
| 12 | +</head> |
| 13 | +<body style="padding-top: 3.5rem;"> |
| 14 | +<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark"> |
| 15 | +<a class="navbar-brand" href="#"></a><button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button> |
| 16 | +<div class="collapse navbar-collapse" id="navbarNav"> |
| 17 | +<ul class="navbar-nav"> |
| 18 | +<li class="nav-item"> |
| 19 | +<a class="nav-link active" href="#">Report</a> |
| 20 | +</li> |
| 21 | +<li class="nav-item" id="nav_enable_datatable"> |
| 22 | +<a class="nav-link" href="?d=">Enable datatable</a> |
| 23 | +</li> |
| 24 | +<li class="nav-item" id="nav_disable_datatable"> |
| 25 | +<a class="nav-link" href="?">Disable datatable</a> |
| 26 | +</li> |
| 27 | +<li class="nav-item"> |
| 28 | +<a class="nav-link" target="_blank" rel="noopener noreferrer" href="https://packagist.org/packages/systemsdk/phpcpd">Package page</a> |
| 29 | +</li> |
| 30 | +</ul> |
| 31 | +</div> |
| 32 | +<img alt="Logo" src="https://systemsdk.github.io/images/logo-white-small.png" style="border-right: 20px solid;"></nav> |
| 33 | +<div class="container"> |
| 34 | +<div class="row"> |
| 35 | +<div class="col"> |
| 36 | +<h4>PHPCPD <font color="#0000FF">8.2.0</font> - Summary of duplicated code</h4> |
| 37 | +<p>This page summarizes the code fragments that have been found at <font color="#0000FF">2025-04-29T17:39:52+00:00</font> to be replicated in the code.</p> |
| 38 | +<table class="table table-light table-bordered table-striped table-hover"> |
| 39 | +<tr> |
| 40 | +<th># Duplications</th><th>Total lines</th><th>Total tokens</th><th>Approximate number of bytes</th> |
| 41 | +</tr> |
| 42 | +<tr> |
| 43 | +<td class="SummaryNumber">1</td><td class="SummaryNumber">59</td><td class="SummaryNumber">136</td><td class="SummaryNumber">544</td> |
| 44 | +</tr> |
| 45 | +</table> |
| 46 | +</div> |
| 47 | +</div> |
| 48 | +<div class="row"> |
| 49 | +<div class="col"> |
| 50 | +<h4>Details of duplicated code</h4> |
| 51 | +</div> |
| 52 | +<table style="width:100%" id="data_table" class="table table-light table-bordered table-striped table-hover"> |
| 53 | +<thead> |
| 54 | +<tr> |
| 55 | +<th>lines</th><th>tokens</th><th>files</th><th>codefragment</th> |
| 56 | +</tr> |
| 57 | +</thead> |
| 58 | +<tbody> |
| 59 | +<tr> |
| 60 | +<td>59</td><td>136</td><td> |
| 61 | +<table class="table table-light table-bordered table-striped table-hover"> |
| 62 | +<tr> |
| 63 | +<th>line</th><th>endline</th><th>path</th> |
| 64 | +</tr> |
| 65 | +<tr> |
| 66 | +<td>116</td><td>175</td><td>/var/www/html/tests/Fixture/Math.php</td> |
| 67 | +</tr> |
| 68 | +<tr> |
| 69 | +<td>217</td><td>276</td><td>/var/www/html/tests/Fixture/Math.php</td> |
| 70 | +</tr> |
| 71 | +</table> |
| 72 | +</td><td> |
| 73 | +<pre> public function div($v1, $v2) |
| 74 | + { |
| 75 | + $v3 = $v1 / ($v2 + $v1); |
| 76 | + if ($v3 &gt; 14) |
| 77 | + { |
| 78 | + $v4 = 0; |
| 79 | + for ($i = 0; $i &lt; $v3; $i++) |
| 80 | + { |
| 81 | + $v4 += ($v2 * $i); |
| 82 | + } |
| 83 | + } |
| 84 | + $v5 = ($v4 &lt; $v3 ? ($v3 - $v4) : ($v4 - $v3)); |
| 85 | + |
| 86 | + $v6 = ($v1 * $v2 * $v3 * $v4 * $v5); |
| 87 | + |
| 88 | + $d = array($v1, $v2, $v3, $v4, $v5, $v6); |
| 89 | + |
| 90 | + $v7 = 1; |
| 91 | + for ($i = 0; $i &lt; $v6; $i++) |
| 92 | + { |
| 93 | + shuffle( $d ); |
| 94 | + $v7 = $v7 + $i * end($d); |
| 95 | + } |
| 96 | + |
| 97 | + $v8 = $v7; |
| 98 | + foreach ( $d as $x ) |
| 99 | + { |
| 100 | + $v8 *= $x; |
| 101 | + } |
| 102 | + |
| 103 | + $v3 = $v1 / ($v2 + $v1); |
| 104 | + if ($v3 &gt; 14) |
| 105 | + { |
| 106 | + $v4 = 0; |
| 107 | + for ($i = 0; $i &lt; $v3; $i++) |
| 108 | + { |
| 109 | + $v4 += ($v2 * $i); |
| 110 | + } |
| 111 | + } |
| 112 | + $v5 = ($v4 &lt; $v3 ? ($v3 - $v4) : ($v4 - $v3)); |
| 113 | + |
| 114 | + $v6 = ($v1 * $v2 * $v3 * $v4 * $v5); |
| 115 | + |
| 116 | + $d = array($v1, $v2, $v3, $v4, $v5, $v6); |
| 117 | + |
| 118 | + $v7 = 1; |
| 119 | + for ($i = 0; $i &lt; $v6; $i++) |
| 120 | + { |
| 121 | + shuffle( $d ); |
| 122 | + $v7 = $v7 + $i * end($d); |
| 123 | + } |
| 124 | + |
| 125 | + $v8 = $v7; |
| 126 | + foreach ( $d as $x ) |
| 127 | + { |
| 128 | + $v8 *= $x; |
| 129 | + } |
| 130 | + |
| 131 | + return $v8; |
| 132 | +</pre> |
| 133 | +</td> |
| 134 | +</tr> |
| 135 | +</tbody> |
| 136 | +</table> |
| 137 | +</div> |
| 138 | +</div> |
| 139 | +<script> |
| 140 | + let params = (new URL(document.location)).searchParams; |
| 141 | + let showDatatable = false; |
| 142 | + |
| 143 | + //------------ can be called with this parameter d |
| 144 | + if (params.get('d') !== null) { // got it via query param d |
| 145 | + showDatatable = true; |
| 146 | + } |
| 147 | + |
| 148 | + if (showDatatable) { |
| 149 | + $("#nav_disable_datatable").show(); |
| 150 | + $("#nav_enable_datatable").hide(); |
| 151 | + $(document).ready( function () { |
| 152 | + $('#data_table').DataTable({ |
| 153 | + dom: "<'row'<'col-sm-12 col-md-4'B><'col-sm-12 col-md-4'l><'col-sm-12 col-md-4'f>>" + |
| 154 | + "<'row'<'col-sm-12'tr>>" + |
| 155 | + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", |
| 156 | + buttons: [ |
| 157 | + 'copy', 'csv', 'excel', 'pdf', 'print' |
| 158 | + ] |
| 159 | + } |
| 160 | + ); |
| 161 | + } ); |
| 162 | + } else { |
| 163 | + $("#nav_disable_datatable").hide(); |
| 164 | + $("#nav_enable_datatable").show(); |
| 165 | + } |
| 166 | + |
| 167 | +</script> |
| 168 | +</body> |
| 169 | +</html> |
0 commit comments