Big update: New way of storing build errors, updated UI, AdminLTE 2, fixes, etc.
This commit is contained in:
parent
9c7a1c7907
commit
7f823b37cf
821 changed files with 164244 additions and 19321 deletions
|
|
@ -12,6 +12,7 @@ namespace PHPCI\Plugin;
|
|||
use PHPCI\Builder;
|
||||
use PHPCI\Helper\Lang;
|
||||
use PHPCI\Model\Build;
|
||||
use PHPCI\Model\BuildError;
|
||||
|
||||
/**
|
||||
* PHP Copy / Paste Detector - Allows PHP Copy / Paste Detector testing.
|
||||
|
|
@ -97,9 +98,8 @@ class PhpCpd implements \PHPCI\Plugin
|
|||
|
||||
print $this->phpci->getLastOutput();
|
||||
|
||||
list($errorCount, $data) = $this->processReport(file_get_contents($tmpfilename));
|
||||
$errorCount = $this->processReport(file_get_contents($tmpfilename));
|
||||
$this->build->storeMeta('phpcpd-warnings', $errorCount);
|
||||
$this->build->storeMeta('phpcpd-data', $data);
|
||||
|
||||
unlink($tmpfilename);
|
||||
|
||||
|
|
@ -122,20 +122,11 @@ class PhpCpd implements \PHPCI\Plugin
|
|||
}
|
||||
|
||||
$warnings = 0;
|
||||
$data = array();
|
||||
|
||||
foreach ($xml->duplication as $duplication) {
|
||||
foreach ($duplication->file as $file) {
|
||||
$fileName = (string)$file['path'];
|
||||
$fileName = str_replace($this->phpci->buildPath, '', $fileName);
|
||||
|
||||
$data[] = array(
|
||||
'file' => $fileName,
|
||||
'line_start' => (int) $file['line'],
|
||||
'line_end' => (int) $file['line'] + (int) $duplication['lines'],
|
||||
'code' => (string) $duplication->codefragment
|
||||
);
|
||||
|
||||
$message = <<<CPD
|
||||
Copy and paste detected:
|
||||
|
||||
|
|
@ -144,6 +135,15 @@ Copy and paste detected:
|
|||
```
|
||||
CPD;
|
||||
|
||||
$this->build->reportError(
|
||||
$this->phpci,
|
||||
'php_cpd',
|
||||
$message,
|
||||
BuildError::SEVERITY_NORMAL,
|
||||
$fileName,
|
||||
$file['line'],
|
||||
(int) $file['line'] + (int) $duplication['lines']
|
||||
);
|
||||
$this->build->reportError($this->phpci, $fileName, $file['line'], $message);
|
||||
|
||||
}
|
||||
|
|
@ -151,6 +151,6 @@ CPD;
|
|||
$warnings++;
|
||||
}
|
||||
|
||||
return array($warnings, $data);
|
||||
return $warnings;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue