neos/neos-development-collection

View on GitHub

Showing 837 of 1,173 total issues

UserService has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class UserService
{

    /**
     * Might be configurable in the future, for now centralising this as a "constant"
Severity: Minor
Found in Neos.Neos/Classes/Domain/Service/UserService.php - About 4 hrs to fix

    Function findDeclaredFusionNamespaces has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function findDeclaredFusionNamespaces()
        {
            $namespaces = [];
    
            $targetDirectory = $this->targetPackageData['path'] . '/Resources/Private';
    Severity: Minor
    Found in Neos.Fusion/Migrations/Code/Version20180211184832.php - About 4 hrs 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 _doXHR has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function _doXHR(data) {
                var self = this;
    
                _start_time = new Date().getTime();
    
    
    Severity: Major
    Found in Neos.Media.Browser/Resources/Public/Libraries/plupload/moxie.js - About 4 hrs to fix

      Function flattenAlohaFormatOptions has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function flattenAlohaFormatOptions(array &$options)
          {
              if (isset($options['properties'])) {
                  foreach (array_keys($options['properties']) as $propertyName) {
                      if (isset($options['properties'][$propertyName]['ui']['aloha'])) {
      Severity: Minor
      Found in Neos.Neos/Classes/Service/NodeTypeSchemaBuilder.php - About 4 hrs 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 setGlobalUiElementLabels has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function setGlobalUiElementLabels($nodeTypeName, array &$configuration)
          {
              $nodeTypeLabelIdPrefix = $this->generateNodeTypeLabelIdPrefix($nodeTypeName);
              if ($this->shouldFetchTranslation($configuration['ui'])) {
                  $configuration['ui']['label'] = $this->getInspectorElementTranslationId($nodeTypeLabelIdPrefix, 'ui', 'label');
      Severity: Minor
      Found in Neos.Neos/Classes/Aspects/NodeTypeConfigurationEnrichmentAspect.php - About 4 hrs 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 evaluateApplyValues has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function evaluateApplyValues($configurationWithEventualProperties, $fusionPath): ?array
          {
              if (isset($configurationWithEventualProperties['__meta']['apply'])) {
                  $fusionObjectType = $configurationWithEventualProperties['__objectType'];
                  if (!preg_match('#<[^>]*>$#', $fusionPath)) {
      Severity: Minor
      Found in Neos.Fusion/Classes/Core/Runtime.php - About 4 hrs 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

      File FrontendNodeRoutePartHandler.php has 350 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      namespace Neos\Neos\Routing;
      
      /*
       * This file is part of the Neos.Neos package.
      Severity: Minor
      Found in Neos.Neos/Classes/Routing/FrontendNodeRoutePartHandler.php - About 4 hrs to fix

        Function resize has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    resize: function(options) {
                        var self = this;
                        var orientation;
                        var scale;
        
        
        Severity: Major
        Found in Neos.Media.Browser/Resources/Public/Libraries/plupload/moxie.js - About 4 hrs to fix

          Function createNodeUri has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createNodeUri(ControllerContext $controllerContext, $node = null, NodeInterface $baseNode = null, $format = null, $absolute = false, array $arguments = [], $section = '', $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], $resolveShortcuts = true): string
              {
                  $this->lastLinkedNode = null;
                  if (!($node instanceof NodeInterface || is_string($node) || $baseNode instanceof NodeInterface)) {
                      throw new \InvalidArgumentException('Expected an instance of NodeInterface or a string for the node argument, or alternatively a baseNode argument.', 1373101025);
          Severity: Minor
          Found in Neos.Neos/Classes/Service/LinkingService.php - About 4 hrs 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 removeUnusedCommand has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function removeUnusedCommand(string $assetSource = '', bool $quiet = false, bool $assumeYes = false, string $onlyTags = '', int $limit = null)
              {
                  $iterator = $this->assetRepository->findAllIterator();
                  $assetCount = $this->assetRepository->countAll();
                  $unusedAssets = [];
          Severity: Minor
          Found in Neos.Media/Classes/Command/MediaCommandController.php - About 4 hrs 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 removeUndefinedProperties has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function removeUndefinedProperties($workspaceName, /** @noinspection PhpUnusedParameterInspection */$dryRun, NodeType $nodeType = null)
              {
                  $this->dispatch(self::EVENT_NOTICE, 'Checking for undefined properties ...');
          
                  /** @var \Neos\ContentRepository\Domain\Model\Workspace $workspace */

          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 _displayThumbs has 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _displayThumbs: function() {
                  var self = this
                  , tw, th // thumb width/height
                  , cols
                  , num = 0 // number of simultaneously visible thumbs

            Method render has 103 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function render()
                {
                    $changes = parent::render();
            
                    $html = '';
            Severity: Major
            Found in Neos.Diff/Classes/Renderer/Html/HtmlSideBySideRenderer.php - About 4 hrs to fix

              Function parseInclude has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function parseInclude($include)
                  {
                      $include = trim($include);
                      $parser = new Parser();
              
              
              Severity: Minor
              Found in Neos.Fusion/Classes/Core/Parser.php - About 4 hrs 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 renderContentChanges has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function renderContentChanges(NodeInterface $changedNode)
                  {
                      $contentChanges = [];
                      $originalNode = $this->getOriginalNode($changedNode);
                      $changeNodePropertiesDefaults = $changedNode->getNodeType()->getDefaultValuesForProperties($changedNode);

              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 move has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function move($targetPath, Workspace $targetWorkspace)
                  {
                      $sourceNodeData = $this;
                      $originalPath = $this->path;
                      if ($originalPath === $targetPath && $this->workspace->getName() === $targetWorkspace) {
              Severity: Minor
              Found in Neos.ContentRepository/Classes/Domain/Model/NodeData.php - About 4 hrs 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

              Runtime has 32 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Runtime
              {
                  /**
                   * Internal constants defining how evaluate should work in case of an error
                   */
              Severity: Minor
              Found in Neos.Fusion/Classes/Core/Runtime.php - About 4 hrs to fix

                Method createChildNodesByNodeType has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function createChildNodesByNodeType(NodeType $nodeType, $workspaceName, $dryRun)
                    {
                        $createdNodesCount = 0;
                        $updatedNodesCount = 0;
                        $incorrectNodeTypeCount = 0;

                  Workspace has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Workspace
                  {
                      /**
                       * This prefix determines if a given workspace (name) is a user workspace.
                       */
                  Severity: Minor
                  Found in Neos.ContentRepository/Classes/Domain/Model/Workspace.php - About 4 hrs to fix

                    File NodeType.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    namespace Neos\ContentRepository\Domain\Model;
                    
                    /*
                     * This file is part of the Neos.ContentRepository package.
                    Severity: Minor
                    Found in Neos.ContentRepository/Classes/Domain/Model/NodeType.php - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language