neos/neos-development-collection

View on GitHub

Showing 907 of 1,362 total issues

Function didInsertElement has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            didInsertElement: function() {
                var that = this,
                    currentQueryTimer;

                this.$().select2({

    Function setOption has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function setOption(option, value, init) {
            var self = this, reinitRequired = false;
    
            function _setOption(option, value, init) {
                var oldValue = settings[option];

      Function FileInput has 124 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function FileInput(options) {
              if (MXI_DEBUG) {
                  Env.log("Instantiating FileInput...");
              }
      
      
      Severity: Major
      Found in Neos.Media.Browser/Resources/Public/Libraries/plupload/moxie.js - About 4 hrs to fix

        Function send has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    send: function(meta, data) {
                        var target = this
                        , isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.verComp(Env.version, 4, '>=') && Env.verComp(Env.version, 7, '<'))
                        , isAndroidBrowser = Env.browser === 'Android Browser'
                        , mustSendAsBinary = false
        Severity: Major
        Found in Neos.Media.Browser/Resources/Public/Libraries/plupload/moxie.js - About 4 hrs to fix

          File UserService.php has 370 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Function buildModuleList has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                public function buildModuleList(ControllerContext $controllerContext)
                {
                    $modules = [];
                    foreach ($this->settings['modules'] as $moduleName => $moduleConfiguration) {
                        if (!$this->isModuleEnabled($moduleName)) {
            Severity: Minor
            Found in Neos.Neos/Classes/Controller/Backend/MenuHelper.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 addMissingDefaultValuesByNodeType has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                public function addMissingDefaultValuesByNodeType(NodeType $nodeType, $workspaceName, $dryRun)
                {
                    $addedMissingDefaultValuesCount = 0;
            
                    $nodeTypes = $this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), false);

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

                public function render()
                {
                    // As we'll be modifying a & b to include our change markers,
                    // we need to get the contents and store them here. That way
                    // we're not going to destroy the original data
            Severity: Minor
            Found in Neos.Diff/Classes/Renderer/Html/HtmlArrayRenderer.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

            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 removeUnusedCommand has a Cognitive Complexity of 30 (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 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 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
                      Severity
                      Category
                      Status
                      Source
                      Language