Skip to content

Commit d85becc

Browse files
author
DKravtsov
committed
Updated phpcpd report schema v1.0.0.
1 parent ef83e7a commit d85becc

File tree

2 files changed

+117
-46
lines changed

2 files changed

+117
-46
lines changed

phpcpd/report/phpcpd-html-v1_0_0.xslt

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@
88

99
<!-- Dependencies:
1010
https://getbootstrap.com/docs/5.3/getting-started/download/
11-
https://datatables.net/download/ (Styling Bootstrap5 + DataTables + Buttons + Column Visibility + HTML5 Export + JSZip + pdfmake + Print view
12-
https://releases.jquery.com/
11+
https://datatables.net/download/ (Styling Bootstrap5 + jQuery + DataTables + Buttons + Column Visibility + HTML5 Export + JSZip + pdfmake + Print view
1312
-->
1413

15-
<link href="https://cdn.jsdelivr.net/npm/[email protected].0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous"/>
16-
<script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"/>
17-
<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"/>
18-
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"/>
19-
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"/>
20-
<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"/>
14+
<link href="https://cdn.jsdelivr.net/npm/[email protected].6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous"/>
15+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"/>
16+
<link href="https://cdn.datatables.net/v/bs5/jq-3.7.0/jszip-3.10.1/dt-2.3.1/b-3.2.3/b-colvis-3.2.3/b-html5-3.2.3/b-print-3.2.3/datatables.min.css" rel="stylesheet" integrity="sha384-ffA5YILdZwUQB7+HlHwFucF4hce41j8Tt6mvi1e0CLeZ0d9LqFUQJDx5vtwqZKah" crossorigin="anonymous"/>
17+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js" integrity="sha384-VFQrHzqBh5qiJIU0uGU5CIW3+OWpdGGJM9LBnGbuIH2mkICcFZ7lPd/AAtI7SNf7" crossorigin="anonymous"/>
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js" integrity="sha384-/RlQG9uf0M2vcTw3CX7fbqgbj/h8wKxw7C3zu9/GxcBPRKOEcESxaxufwRXqzq6n" crossorigin="anonymous"/>
19+
<script src="https://cdn.datatables.net/v/bs5/jq-3.7.0/jszip-3.10.1/dt-2.3.1/b-3.2.3/b-colvis-3.2.3/b-html5-3.2.3/b-print-3.2.3/datatables.min.js" integrity="sha384-C5Q/xdoW8seeaT5jRMV9lAiJQNoGaRaJkyJ/A7lEdXF4pYx8lQjdNBXQ/KlbQA83" crossorigin="anonymous"/>
2120
<title>PHPCPD Report</title>
2221
<link rel="icon" href="https://systemsdk.github.io/images/favicon.ico" sizes="32x32" />
2322

2423
</head>
25-
<body style="padding-top: 3.5rem;">
24+
<body style="padding-top: 4.5rem;">
2625
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
27-
<a class="navbar-brand" href="#"></a>
28-
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
29-
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
26+
<a class="navbar-brand" href="#"><img alt="Logo" src="https://systemsdk.github.io/images/logo-white-small.png"/></a>
27+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
3028
<span class="navbar-toggler-icon"></span>
3129
</button>
3230
<div class="collapse navbar-collapse" id="navbarNav">
@@ -45,7 +43,6 @@
4543
</li>
4644
</ul>
4745
</div>
48-
<img alt="Logo" src="https://systemsdk.github.io/images/logo-white-small.png" style="border-right: 20px solid;"/>
4946
</nav>
5047

5148
<div class="container">
@@ -105,20 +102,57 @@
105102
$("#nav_enable_datatable").hide();
106103
$(document).ready( function () {
107104
$('#data_table').DataTable({
108-
dom: "&lt;'row'&lt;'col-sm-12 col-md-4'B>&lt;'col-sm-12 col-md-4'l>&lt;'col-sm-12 col-md-4'f>>" +
109-
"&lt;'row'&lt;'col-sm-12'tr>>" +
110-
"&lt;'row'&lt;'col-sm-12 col-md-5'i>&lt;'col-sm-12 col-md-7'p>>",
105+
layout: {
106+
topStart: ['buttons', 'pageLength']
107+
},
111108
buttons: [
112-
'copy', 'csv', 'excel', 'pdf', 'print'
109+
{
110+
extend: 'copy',
111+
text: ' Copy',
112+
exportOptions: {
113+
trim: false,
114+
stripNewlines: false
115+
}
116+
},
117+
{
118+
extend: 'csv',
119+
text: ' CSV',
120+
exportOptions: {
121+
trim: false,
122+
stripNewlines: false
123+
}
124+
},
125+
{
126+
extend: 'excel',
127+
text: ' Excel',
128+
exportOptions: {
129+
trim: false,
130+
stripNewlines: false
131+
}
132+
},
133+
{
134+
extend: 'pdf',
135+
text: ' PDF',
136+
exportOptions: {
137+
trim: false,
138+
stripNewlines: false
139+
}
140+
},
141+
{
142+
extend: 'print',
143+
text: 'Print',
144+
exportOptions: {
145+
stripHtml: false,
146+
stripNewlines: false
147+
}
148+
}
113149
]
114-
}
115-
);
116-
} );
150+
});
151+
});
117152
} else {
118153
$("#nav_disable_datatable").hide();
119154
$("#nav_enable_datatable").show();
120155
}
121-
122156
</script>
123157

124158
</body>

phpcpd/report/report-example.html

Lines changed: 62 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<head>
44
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
55
<meta charset="utf-8">
6-
<link href="https://cdn.jsdelivr.net/npm/[email protected].0-alpha3/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>
6+
<link href="https://cdn.jsdelivr.net/npm/[email protected].6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
7+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"></script>
8+
<link href="https://cdn.datatables.net/v/bs5/jq-3.7.0/jszip-3.10.1/dt-2.3.1/b-3.2.3/b-colvis-3.2.3/b-html5-3.2.3/b-print-3.2.3/datatables.min.css" rel="stylesheet" integrity="sha384-ffA5YILdZwUQB7+HlHwFucF4hce41j8Tt6mvi1e0CLeZ0d9LqFUQJDx5vtwqZKah" crossorigin="anonymous">
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js" integrity="sha384-VFQrHzqBh5qiJIU0uGU5CIW3+OWpdGGJM9LBnGbuIH2mkICcFZ7lPd/AAtI7SNf7" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js" integrity="sha384-/RlQG9uf0M2vcTw3CX7fbqgbj/h8wKxw7C3zu9/GxcBPRKOEcESxaxufwRXqzq6n" crossorigin="anonymous"></script><script src="https://cdn.datatables.net/v/bs5/jq-3.7.0/jszip-3.10.1/dt-2.3.1/b-3.2.3/b-colvis-3.2.3/b-html5-3.2.3/b-print-3.2.3/datatables.min.js" integrity="sha384-C5Q/xdoW8seeaT5jRMV9lAiJQNoGaRaJkyJ/A7lEdXF4pYx8lQjdNBXQ/KlbQA83" crossorigin="anonymous"></script>
1010
<title>PHPCPD Report</title>
1111
<link rel="icon" href="https://systemsdk.github.io/images/favicon.ico" sizes="32x32">
1212
</head>
13-
<body style="padding-top: 3.5rem;">
13+
<body style="padding-top: 4.5rem;">
1414
<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>
15+
<a class="navbar-brand" href="#"><img alt="Logo" src="https://systemsdk.github.io/images/logo-white-small.png"></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>
1616
<div class="collapse navbar-collapse" id="navbarNav">
1717
<ul class="navbar-nav">
1818
<li class="nav-item">
@@ -29,12 +29,12 @@
2929
</li>
3030
</ul>
3131
</div>
32-
<img alt="Logo" src="https://systemsdk.github.io/images/logo-white-small.png" style="border-right: 20px solid;"></nav>
32+
</nav>
3333
<div class="container">
3434
<div class="row">
3535
<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>
36+
<h4>PHPCPD <font color="#0000FF">8.2.3</font> - Summary of duplicated code</h4>
37+
<p>This page summarizes the code fragments that have been found at <font color="#0000FF">2025-05-25T16:09:03+00:00</font> to be replicated in the code.</p>
3838
<table class="table table-light table-bordered table-striped table-hover">
3939
<tr>
4040
<th># Duplications</th><th>Total lines</th><th>Total tokens</th><th>Approximate number of bytes</th>
@@ -73,22 +73,22 @@ <h4>Details of duplicated code</h4>
7373
<pre> public function div($v1, $v2)
7474
{
7575
$v3 = $v1 / ($v2 + $v1);
76-
if ($v3 > 14)
76+
if ($v3 &gt; 14)
7777
{
7878
$v4 = 0;
79-
for ($i = 0; $i < $v3; $i++)
79+
for ($i = 0; $i &lt; $v3; $i++)
8080
{
8181
$v4 += ($v2 * $i);
8282
}
8383
}
84-
$v5 = ($v4 < $v3 ? ($v3 - $v4) : ($v4 - $v3));
84+
$v5 = ($v4 &lt; $v3 ? ($v3 - $v4) : ($v4 - $v3));
8585

8686
$v6 = ($v1 * $v2 * $v3 * $v4 * $v5);
8787

8888
$d = array($v1, $v2, $v3, $v4, $v5, $v6);
8989

9090
$v7 = 1;
91-
for ($i = 0; $i < $v6; $i++)
91+
for ($i = 0; $i &lt; $v6; $i++)
9292
{
9393
shuffle( $d );
9494
$v7 = $v7 + $i * end($d);
@@ -101,22 +101,22 @@ <h4>Details of duplicated code</h4>
101101
}
102102

103103
$v3 = $v1 / ($v2 + $v1);
104-
if ($v3 > 14)
104+
if ($v3 &gt; 14)
105105
{
106106
$v4 = 0;
107-
for ($i = 0; $i < $v3; $i++)
107+
for ($i = 0; $i &lt; $v3; $i++)
108108
{
109109
$v4 += ($v2 * $i);
110110
}
111111
}
112-
$v5 = ($v4 < $v3 ? ($v3 - $v4) : ($v4 - $v3));
112+
$v5 = ($v4 &lt; $v3 ? ($v3 - $v4) : ($v4 - $v3));
113113

114114
$v6 = ($v1 * $v2 * $v3 * $v4 * $v5);
115115

116116
$d = array($v1, $v2, $v3, $v4, $v5, $v6);
117117

118118
$v7 = 1;
119-
for ($i = 0; $i < $v6; $i++)
119+
for ($i = 0; $i &lt; $v6; $i++)
120120
{
121121
shuffle( $d );
122122
$v7 = $v7 + $i * end($d);
@@ -150,20 +150,57 @@ <h4>Details of duplicated code</h4>
150150
$("#nav_enable_datatable").hide();
151151
$(document).ready( function () {
152152
$('#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>>",
153+
layout: {
154+
topStart: ['buttons', 'pageLength']
155+
},
156156
buttons: [
157-
'copy', 'csv', 'excel', 'pdf', 'print'
157+
{
158+
extend: 'copy',
159+
text: ' Copy',
160+
exportOptions: {
161+
trim: false,
162+
stripNewlines: false
163+
}
164+
},
165+
{
166+
extend: 'csv',
167+
text: ' CSV',
168+
exportOptions: {
169+
trim: false,
170+
stripNewlines: false
171+
}
172+
},
173+
{
174+
extend: 'excel',
175+
text: ' Excel',
176+
exportOptions: {
177+
trim: false,
178+
stripNewlines: false
179+
}
180+
},
181+
{
182+
extend: 'pdf',
183+
text: ' PDF',
184+
exportOptions: {
185+
trim: false,
186+
stripNewlines: false
187+
}
188+
},
189+
{
190+
extend: 'print',
191+
text: 'Print',
192+
exportOptions: {
193+
stripHtml: false,
194+
stripNewlines: false
195+
}
196+
}
158197
]
159-
}
160-
);
161-
} );
198+
});
199+
});
162200
} else {
163201
$("#nav_disable_datatable").hide();
164202
$("#nav_enable_datatable").show();
165203
}
166-
167204
</script>
168205
</body>
169206
</html>

0 commit comments

Comments
 (0)