tapestry-cloud/tapestry

View on GitHub

Showing 282 of 291 total issues

Avoid too many return statements within this method.
Open

        return $value;
Severity: Major
Found in src/ArrayContainer.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return rawurlencode($part);
    Severity: Major
    Found in src/Entities/Url.php - About 30 mins to fix

      Missing class import via use statement (line '53', column '23').
      Open

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

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '162', column '40').
      Open

              if ($file->getData('date', new \DateTime()) <= $this->now) {

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '102', column '27').
      Open

                      throw new \Exception('Error occurred while replacing category permalink string.');
      Severity: Minor
      Found in src/Entities/Permalink.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '41', column '23').
      Open

                  throw new \Exception('The site url is not set in your site configuration.');
      Severity: Minor
      Found in src/Entities/Url.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '56', column '23').
      Open

                  throw new \Exception('This CachedFile is not for uid ['.$file->getUid().']');
      Severity: Minor
      Found in src/Entities/CachedFile.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '201', column '23').
      Open

                  throw new \Exception('The file ['.$this->fileInfo->getRelativePathname().'] has not been loaded.');
      Severity: Minor
      Found in src/Entities/File.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      The method getCompiled has a boolean flag argument $pretty, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function getCompiled(File $file, $pretty = true)
      Severity: Minor
      Found in src/Entities/Permalink.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

      Missing class import via use statement (line '288', column '31').
      Open

                          throw new \Exception('The date ['.$data['date'].'] is in a format not supported by Tapestry.');
      Severity: Minor
      Found in src/Entities/File.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Function str_contains has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          function str_contains($haystack, $needles)
          {
              foreach ((array) $needles as $needle) {
                  if ($needle != '' && strpos($haystack, $needle) !== false) {
                      return true;
      Severity: Minor
      Found in src/helpers.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function starts_with has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          function starts_with($haystack, $needles)
          {
              foreach ((array) $needles as $needle) {
                  if ($needle != '' && strpos($haystack, $needle) === 0) {
                      return true;
      Severity: Minor
      Found in src/helpers.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function removeNestedValueByKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function removeNestedValueByKey($key)
          {
              // Bust Cache
              $this->removeKeyFromNestedCache($key);
      
      
      Severity: Minor
      Found in src/ArrayContainer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function encode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function encode($uri = '')
          {
              $parts = explode('/', $uri);
              foreach ($parts as &$part) {
                  if (strpos($part, 'index') !== false) {
      Severity: Minor
      Found in src/Entities/Url.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function allFilesGenerated has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function allFilesGenerated()
          {
              foreach ($this->files as $file) {
                  if ($uses = $file->getData('generator')) {
                      if (count($uses) > 0) {
      Severity: Minor
      Found in src/Modules/Content/Compile.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function report has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function report()
          {
              $report = [];
              foreach ($this->items as $item) {
                  $name = explode('_', $item['name']);
      Severity: Minor
      Found in src/Profiler.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function fire has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function fire()
          {
              try {
                  $this->tapestry->setInput($this->input);
                  $this->tapestry->setOutput($this->output);
      Severity: Minor
      Found in src/Console/Commands/ServeCommand.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute(InputInterface $input, OutputInterface $output)
          {
              try {
                  $this->input = $input;
                  $this->output = $output;
      Severity: Minor
      Found in src/Console/Commands/Command.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function __invoke has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __invoke(Project $project, OutputInterface $output)
          {
              foreach ($this->configuration->get('copy') as $path) {
                  $finder = new Finder();
                  $basePath = $project->sourceDirectory.DIRECTORY_SEPARATOR.$path;
      Severity: Minor
      Found in src/Modules/Content/Copy.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function canGenerate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function canGenerate()
          {
              foreach ($this->generatedFiles as $file) {
                  if ($uses = $file->getData('generator')) {
                      if (count($uses) > 0) {
      Severity: Minor
      Found in src/Entities/Generators/FileGenerator.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language