-
Notifications
You must be signed in to change notification settings - Fork 2
/
pmd-cpd.xml
101 lines (89 loc) · 3.9 KB
/
pmd-cpd.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0" encoding="UTF-8"?>
<pmd-cpd>
<duplication lines="24" tokens="34">
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Helper.php" line="16"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Helper1.php" line="17"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Helper2.php" line="18"/>
<codefragment>declare(strict_types=1);
namespace JBZoo\CIReportConverter;
use JBZoo\Utils\Str;
/**
* Class Helper
* @package JBZoo\CIReportConverter
*/
class Helper
{
/**
* @param array $data
* @return string|null
*/
public static function descAsList(array $data): ?string
{
$result = Str::listToDescription($data, true);
if (null === $result) {
return null;
}
return "\n{$result}";
</codefragment>
</duplication>
<duplication lines="14" tokens="28">
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/TeamCityTestsConverter.php" line="65"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/TeamCityInspectionsConverter.php" line="66"/>
<codefragment> $this->renderSuite($sourceSuite);
$buffer = $this->tcLogger->getWriter();
if ($buffer instanceof Buffer) {
return implode('', $buffer->getBuffer());
}
return '';
}
/**
* @param SourceSuite $sourceSuite
*/
private function renderSuite(SourceSuite $sourceSuite): void
</codefragment>
</duplication>
<duplication lines="12" tokens="40">
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/TeamCityTestsConverter.php" line="46"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/TeamCityInspectionsConverter.php" line="51"/>
<codefragment> public function __construct(array $params = [], ?int $flowId = null, ?AbstractWriter $tcWriter = null)
{
$this->tcLogger = new TeamCity($tcWriter ?: new Buffer(), $flowId, $params);
}
/**
* @inheritDoc
*/
public function fromInternal(SourceSuite $sourceSuite): string
{
if ($this->flowId > 0) {
$this->tcLogger->setFlowId($this->flowId);
</codefragment>
</duplication>
<duplication lines="11" tokens="31">
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/PhpDependStatsTcConverter.php" line="38"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/PhpMetricsStatsTcConverter.php" line="38"/>
<codefragment> public function toInternalMetric(string $sourceCode): Metrics
{
$xmlAsArray = Xml::dom2Array(Xml::createDomDocument($sourceCode));
$attrs = data($xmlAsArray)->findArray('_children.0._attrs');
unset(
$attrs['generated'],
$attrs['pdepend']
);
return self::buildMetrics($attrs, new PhpDepend());
</codefragment>
</duplication>
<duplication lines="8" tokens="24">
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/CheckStyleConverter.php" line="49"/>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/PhpMndConverter.php" line="49"/>
<codefragment> $relFilename = $this->cleanFilepath($file['_attrs']['name'] ?? 'undefined');
$absFilename = $this->getFullPath($relFilename);
$suite = $sourceSuite->addSuite($relFilename);
$suite->file = $absFilename;
foreach ($file['_children'] as $errorNode) {
$error = data($errorNode['_attrs']);
</codefragment>
</duplication>
<duplication>
<file path="/Users/smetdenis/Work/projects/jbzoo-ci-report-converter/src/Converters/CheckStyleConverter.php" line="66"/>
</duplication>
</pmd-cpd>