Showing 282 of 291 total issues
The method generate() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
Open
public function generate(Project $project)
{
$newFile = clone $this->file;
$newFile->setData([
'generator' => array_filter($this->file->getData('generator'), function ($value) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Only one argument is allowed per line in a multi-line function call Open
Open
$this->getName(), $this->getVersion(), $this->tapestry['environment']);
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
preg_match('/^(\d{4}-\d{2}-\d{2})-(.*)/', $this->fileInfo->getBasename('.'.$this->fileInfo->getExtension()),
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
$this->getName(), $this->getVersion(), $this->tapestry['environment']);
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
Open
new InputOption('--json', false, InputOption::VALUE_NONE, 'Output a json file containing the current build state.'),
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
// Kick off the generation with the first generator. Because File generators can either mutate the current File
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
private function iterateProjectContentTypes(ContentTypeFactory $contentTypes, Project $project, OutputInterface $output)
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
Open
new InputOption('--clear', null, InputOption::VALUE_NONE, 'Clear the destination path and disable caching.'),
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
if ($this->input->getOption('force') === false && Comparator::greaterThanOrEqualTo(Tapestry::VERSION, $latestVersion)) {
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
Open
// If we are the first page, then Pagination will only have two pages (this and the next one), also there will be
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
Open
// @todo check to see if 'item' should be set within the view's scope; it feels weird that this is the only generator doing so
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
Open
$cache->setItem($f->getUid(), new CachedFile($f, $invalidation->get($f->getUid(), []), $project->sourceDirectory));
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
Open
// When Writing, if you find a FileGenerator simply execute its generate() method and it should do the rest. This
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
Open
if ($envConfigPathName = $this->identifyConfigurationPath($tapestry['currentWorkingDirectory'], $tapestry['environment'])) {
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
Open
if ($this->filesystem->exists($currentWorkingDirectory) && $this->finder->in($currentWorkingDirectory)->count() > 0) {
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
Open
$filesystem->copy($this->file->getFileInfo()->getPathname(), $this->destinationPath.DIRECTORY_SEPARATOR.$outputPath);
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
$report[$name]['execution_time'] = round(($report[$name]['FINISH_time'] - $report[$name]['START_time']), 3);
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
$report[$name]['memory_consumption'] = $report[$name]['FINISH_memory_use'] - $report[$name]['START_memory_use'];
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
Open
new InputOption('--no-write', false, InputOption::VALUE_NONE, 'When set Tapestry will build the state but not commit to the file system.'),
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
Open
$this->output->writeln('Task complete in: '.$stopwatch.'s ['.file_size_convert(memory_get_usage(true)).'/'.file_size_convert(memory_get_peak_usage(true)).']');
- Exclude checks