Showing 282 of 291 total issues
The method encodePart() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
Open
private function encodePart($part)
{
if (strpos($part, '?') !== false) {
if (strpos($part, '?') === 0) {
$output = '?';
- 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
$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
Line exceeds 120 characters; contains 148 characters Open
Open
* @param bool $overWrite should adding overwrite existing; if false an exception will be thrown if a matching collection already found
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
$this->error('The project directory ['.$currentWorkingDirectory.'] does not exist. Doing nothing and exiting.');
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
Open
$project = new Project($container->get('currentWorkingDirectory'), $container->get('destinationDirectory'), $container->get('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 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 121 characters Open
Open
new InputOption('rollback', 'r', InputOption::VALUE_NONE, 'Revert to an older installation of tapestry'),
- 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 138 characters Open
Open
$this->output->writeln('You already have the latest version of Tapestry ['.Tapestry::VERSION.']. Doing nothing and exiting.');
- Exclude checks
Line exceeds 120 characters; contains 165 characters Open
Open
throw new \Exception('The collection ['.$this->pathLookupTable[$contentType->getPath()].'] already collects for the path ['.$contentType->getPath().']');
- 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 121 characters Open
Open
$this->engine->getProject()->get('file_layout_cache')->merge([$this->file->getUid() => [$this->layoutName]]);
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
Open
throw new LockException('Tapestry is already running; please wait for the previous process to complete or delete the .lock file.');
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
Open
$output->writeln('Generating site from <comment>'.$project->sourceDirectory.'</comment> to <comment>'.$project->destinationDirectory.'</comment>');
- 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
Line exceeds 120 characters; contains 121 characters Open
Open
$this->filesystem->dumpFile($project->currentWorkingDirectory.DIRECTORY_SEPARATOR.'db.json', json_encode($json));
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
Open
$currentWorkingDirectory .= ((substr($currentWorkingDirectory, -1, 1) === DIRECTORY_SEPARATOR) ? '' : DIRECTORY_SEPARATOR).$name;
- Exclude checks