tapestry-cloud/tapestry

View on GitHub

Showing 282 of 291 total issues

The method encodePart() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

    private function encodePart($part)
    {
        if (strpos($part, '?') !== false) {
            if (strpos($part, '?') === 0) {
                $output = '?';
Severity: Minor
Found in src/Entities/Url.php by phpmd

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

                $this->getName(), $this->getVersion(), $this->tapestry['environment']);
Severity: Minor
Found in src/Console/Application.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

                $this->getName(), $this->getVersion(), $this->tapestry['environment']);
Severity: Minor
Found in src/Console/Application.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

        preg_match('/^(\d{4}-\d{2}-\d{2})-(.*)/', $this->fileInfo->getBasename('.'.$this->fileInfo->getExtension()),
Severity: Minor
Found in src/Entities/File.php by phpcodesniffer

Line exceeds 120 characters; contains 148 characters
Open

     * @param bool        $overWrite   should adding overwrite existing; if false an exception will be thrown if a matching collection already found

Line exceeds 120 characters; contains 124 characters
Open

            $this->error('The project directory ['.$currentWorkingDirectory.'] does not exist. Doing nothing and exiting.');

Line exceeds 120 characters; contains 152 characters
Open

            $project = new Project($container->get('currentWorkingDirectory'), $container->get('destinationDirectory'), $container->get('environment'));

Line exceeds 120 characters; contains 132 characters
Open

                new InputOption('--json', false, InputOption::VALUE_NONE, 'Output a json file containing the current build state.'),

Line exceeds 120 characters; contains 121 characters
Open

        // When Writing, if you find a FileGenerator simply execute its generate() method and it should do the rest. This

Line exceeds 120 characters; contains 121 characters
Open

                new InputOption('rollback', 'r', InputOption::VALUE_NONE, 'Revert to an older installation of tapestry'),

Line exceeds 120 characters; contains 132 characters
Open

        if ($envConfigPathName = $this->identifyConfigurationPath($tapestry['currentWorkingDirectory'], $tapestry['environment'])) {

Line exceeds 120 characters; contains 138 characters
Open

            $this->output->writeln('You already have the latest version of Tapestry ['.Tapestry::VERSION.']. Doing nothing and exiting.');

Line exceeds 120 characters; contains 165 characters
Open

            throw new \Exception('The collection ['.$this->pathLookupTable[$contentType->getPath()].'] already collects for the path ['.$contentType->getPath().']');

Line exceeds 120 characters; contains 125 characters
Open

                new InputOption('--clear', null, InputOption::VALUE_NONE, 'Clear the destination path and disable caching.'),

Line exceeds 120 characters; contains 121 characters
Open

            $this->engine->getProject()->get('file_layout_cache')->merge([$this->file->getUid() => [$this->layoutName]]);
Severity: Minor
Found in src/Plates/Template.php by phpcodesniffer

Line exceeds 120 characters; contains 147 characters
Open

                throw new LockException('Tapestry is already running; please wait for the previous process to complete or delete the .lock file.');

Line exceeds 120 characters; contains 155 characters
Open

        $output->writeln('Generating site from <comment>'.$project->sourceDirectory.'</comment> to <comment>'.$project->destinationDirectory.'</comment>');
Severity: Minor
Found in src/Generator.php by phpcodesniffer

Line exceeds 120 characters; contains 167 characters
Open

        $this->output->writeln('Task complete in: '.$stopwatch.'s ['.file_size_convert(memory_get_usage(true)).'/'.file_size_convert(memory_get_peak_usage(true)).']');

Line exceeds 120 characters; contains 121 characters
Open

        $this->filesystem->dumpFile($project->currentWorkingDirectory.DIRECTORY_SEPARATOR.'db.json', json_encode($json));
Severity: Minor
Found in src/Modules/Api/Json.php by phpcodesniffer

Line exceeds 120 characters; contains 141 characters
Open

            $currentWorkingDirectory .= ((substr($currentWorkingDirectory, -1, 1) === DIRECTORY_SEPARATOR) ? '' : DIRECTORY_SEPARATOR).$name;
Severity
Category
Status
Source
Language