tapestry-cloud/tapestry

View on GitHub

Showing 282 of 291 total issues

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

    public function generate(Project $project)
    {
        $newFile = clone $this->file;
        $newFile->setData([
            'generator' => array_filter($this->file->getData('generator'), function ($value) {

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

        preg_match('/^(\d{4}-\d{2}-\d{2})-(.*)/', $this->fileInfo->getBasename('.'.$this->fileInfo->getExtension()),
Severity: Minor
Found in src/Entities/File.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

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 123 characters
Open

            // Kick off the generation with the first generator. Because File generators can either mutate the current File

Line exceeds 120 characters; contains 124 characters
Open

    private function iterateProjectContentTypes(ContentTypeFactory $contentTypes, Project $project, OutputInterface $output)

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 128 characters
Open

        if ($this->input->getOption('force') === false && Comparator::greaterThanOrEqualTo(Tapestry::VERSION, $latestVersion)) {

Line exceeds 120 characters; contains 125 characters
Open

            // If we are the first page, then Pagination will only have two pages (this and the next one), also there will be

Line exceeds 120 characters; contains 134 characters
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

Line exceeds 120 characters; contains 127 characters
Open

            $cache->setItem($f->getUid(), new CachedFile($f, $invalidation->get($f->getUid(), []), $project->sourceDirectory));

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 132 characters
Open

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

Line exceeds 120 characters; contains 126 characters
Open

        if ($this->filesystem->exists($currentWorkingDirectory) && $this->finder->in($currentWorkingDirectory)->count() > 0) {

Line exceeds 120 characters; contains 125 characters
Open

        $filesystem->copy($this->file->getFileInfo()->getPathname(), $this->destinationPath.DIRECTORY_SEPARATOR.$outputPath);

Line exceeds 120 characters; contains 124 characters
Open

                $report[$name]['execution_time'] = round(($report[$name]['FINISH_time'] - $report[$name]['START_time']), 3);
Severity: Minor
Found in src/Profiler.php by phpcodesniffer

Line exceeds 120 characters; contains 128 characters
Open

                $report[$name]['memory_consumption'] = $report[$name]['FINISH_memory_use'] - $report[$name]['START_memory_use'];
Severity: Minor
Found in src/Profiler.php by phpcodesniffer

Line exceeds 120 characters; contains 155 characters
Open

                new InputOption('--no-write', false, InputOption::VALUE_NONE, 'When set Tapestry will build the state but not commit to the file system.'),

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)).']');
Severity
Category
Status
Source
Language