symphonycms/symphony-2

View on GitHub

Showing 844 of 844 total issues

Function symphonyNotify has 156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.symphonyNotify = function(options) {
        var objects = this,
            settings = {
                items: 'p.notice',
                storage: 'symphony.notify.' + Symphony.Context.get('root').replace('http://', '')
Severity: Major
Found in symphony/assets/js/src/symphony.notify.js - About 6 hrs to fix

    Function Symphony has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    var Symphony = (function($, crossroads) {
        'use strict';
    
        // Internal Symphony storage
        var Storage = {
    Severity: Minor
    Found in symphony/assets/js/src/symphony.js - About 6 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 __viewEdit has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __viewEdit()
        {
            $section_id = $this->_context['id'];
            $section = (new SectionManager)->select()->section($section_id)->execute()->next();
    
    
    Severity: Minor
    Found in symphony/content/content.blueprintssections.php - About 6 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

    Method generate has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function generate(array &$param_pool = null)
        {
            $result = new XMLElement($this->dsParamROOTELEMENT);
            $this->_param_pool = $param_pool;
            $requiresPagination = (!isset($this->dsParamPAGINATERESULTS) ||
    Severity: Major
    Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 6 hrs to fix

      Function delete has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function delete($entries, $section_id = null)
          {
              $needs_data = true;
      
              if (!is_array($entries)) {
      Severity: Minor
      Found in symphony/lib/toolkit/class.entrymanager.php - About 5 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 view has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          public function view()
          {
              if (isset($this->_context['token']) && $this->_context['action'] === 'reset-password') {
                  if (Administration::instance()->loginFromToken($this->_context['token'])) {
                      if (Administration::instance()->isLoggedIn()) {
      Severity: Minor
      Found in symphony/content/content.login.php - About 5 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 class.emailgateway.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * @package toolkit
       */
      Severity: Minor
      Found in symphony/lib/toolkit/class.emailgateway.php - About 5 hrs to fix

        Method buildSingleWhereClauseFromArray has 145 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            final public function buildSingleWhereClauseFromArray($k, $c)
            {
                $op = '=';
                if (is_object($c)) {
                    if (!($c instanceof DatabaseSubQuery)) {
        Severity: Major
        Found in symphony/lib/toolkit/trait.databasewheredefinition.php - About 5 hrs to fix

          Method __formAction has 144 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __formAction()
              {
                  $fields = $_POST['fields'];
                  $this->_errors = array();
                  $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::EVENT);
          Severity: Major
          Found in symphony/content/content.blueprintsevents.php - About 5 hrs to fix

            Function Calendar has 143 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Symphony.Interface.Calendar = function() {
                    var template = '<div class="calendar"><nav><a class="clndr-previous-button">previous</a><div class="switch"><ul class="months"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><ul class="years"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul></div><a class="clndr-next-button">next</a></nav><table><thead><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr></thead><tbody><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr></tbody></table></div>',
                        context, calendar, storage, format, datetime, clndr;
            
                    var init = function(element) {
            Severity: Major
            Found in symphony/assets/js/src/symphony.calendar.js - About 5 hrs to fix

              File class.xmlelement.php has 404 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * @package toolkit
               */
              /**
              Severity: Minor
              Found in symphony/lib/toolkit/class.xmlelement.php - About 5 hrs to fix

                XMLElement has 41 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class XMLElement implements IteratorAggregate
                {
                    /**
                     * This is an array of HTML elements that are self closing.
                     * @var array
                Severity: Minor
                Found in symphony/lib/toolkit/class.xmlelement.php - About 5 hrs to fix

                  File class.widget.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @package toolkit
                   */
                  /**
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.widget.php - About 5 hrs to fix

                    File class.databasestatement.php has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     * @package toolkit
                     */
                    Severity: Minor
                    Found in symphony/lib/toolkit/class.databasestatement.php - About 5 hrs to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              var down = function(input) {
                                  var suggestions = input.next('.suggestions'),
                                      active = suggestions.find('li:not(.help).active').removeClass('active'),
                                      next = active.next('li:not(.help):visible');
                      
                      
                      Severity: Major
                      Found in symphony/assets/js/src/symphony.suggestions.js and 1 other location - About 5 hrs to fix
                      symphony/assets/js/src/symphony.suggestions.js on lines 379..395

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 144.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              var up = function(input) {
                                  var suggestions = input.next('.suggestions'),
                                      active = suggestions.find('li:not(.help).active').removeClass('active'),
                                      prev = active.prev('li:not(.help):visible');
                      
                      
                      Severity: Major
                      Found in symphony/assets/js/src/symphony.suggestions.js and 1 other location - About 5 hrs to fix
                      symphony/assets/js/src/symphony.suggestions.js on lines 397..413

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 144.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Function buildEntry has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function buildEntry(array $entry)
                          {
                              if (!isset($entry['id'], $entry['section_id'], $entry['creation_date'], $entry['modification_date'])) {
                                  return $entry;
                              }
                      Severity: Minor
                      Found in symphony/lib/toolkit/class.entryqueryresult.php - About 5 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

                      Method __actionEdit has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __actionEdit()
                          {
                              if ($this->_context['action'] !== 'new' && !$page_id = $this->_context['id']) {
                                  redirect(SYMPHONY_URL . '/blueprints/pages/');
                              }
                      Severity: Major
                      Found in symphony/content/content.blueprintspages.php - About 5 hrs to fix

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                if ($formHasErrors) {
                                    $this->pageAlert(
                                        __('An error occurred while processing this form. See below for details.'),
                                        Alert::ERROR
                                    );
                        Severity: Major
                        Found in symphony/content/content.blueprintssections.php and 2 other locations - About 5 hrs to fix
                        symphony/content/content.blueprintsdatasources.php on lines 36..63
                        symphony/content/content.blueprintsevents.php on lines 40..67

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 189.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                if ($formHasErrors) {
                                    $this->pageAlert(
                                        __('An error occurred while processing this form. See below for details.'),
                                        Alert::ERROR
                                    );
                        Severity: Major
                        Found in symphony/content/content.blueprintsevents.php and 2 other locations - About 5 hrs to fix
                        symphony/content/content.blueprintsdatasources.php on lines 36..63
                        symphony/content/content.blueprintssections.php on lines 357..384

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 189.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language