symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Function getAssociationContext has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAssociationContext()
    {
        $context = Symphony::Engine()->Page->getContext();
        $associations = $context['associations']['parent'];
        $field_association = array();
Severity: Minor
Found in symphony/lib/toolkit/class.field.php - About 1 hr 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 fetch has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function fetch($entry_id = null, $section_id = null, $limit = null, $start = null, $where = null, $joins = null, $group = false, $buildentries = true, $element_names = null, $enable_sort = true)
Severity: Major
Found in symphony/lib/toolkit/class.entrymanager.php - About 1 hr to fix

    Function appendValues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        final protected function appendValues(array $values)
        {
            if ($this->isUsingPlaceholders()) {
                $values = array_values($values);
            } else {
    Severity: Minor
    Found in symphony/lib/toolkit/class.databasestatement.php - About 1 hr 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 buildDSRetrievalSQL has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
        {
            if (Symphony::Log()) {
                Symphony::Log()->pushDeprecateWarningToLog(
                    get_called_class() . '::buildDSRetrievalSQL()',
    Severity: Minor
    Found in symphony/lib/toolkit/fields/field.input.php - About 1 hr 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 displayPublishPanel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
        {
            if (is_dir(DOCROOT . $this->get('destination') . '/') === false) {
                $flagWithError = __('The destination directory, %s, does not exist.', array(
                    '<code>' . $this->get('destination') . '</code>'
    Severity: Minor
    Found in symphony/lib/toolkit/fields/field.upload.php - About 1 hr 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 appendErrors has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function appendErrors(XMLElement $result, array $fields, $errors, $post_values)
        {
            $result->setAttribute('result', 'error');
            $result->appendChild(new XMLElement('message', __('Entry encountered errors when saving.'), array(
                'message-id' => EventMessages::ENTRY_ERRORS
    Severity: Minor
    Found in symphony/lib/toolkit/events/class.event.section.php - About 1 hr 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 displayPublishPanel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
        {
            $value = null;
    
            if (isset($data['value'])) {
    Severity: Minor
    Found in symphony/lib/toolkit/fields/field.taglist.php - About 1 hr 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 serializeArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function serializeArray(array $arr, $indentation = 0, $tab = self::TAB)
        {
            $tabs = '';
            $closeTabs = '';
            for ($i = 0; $i < $indentation; $i++) {
    Severity: Minor
    Found in symphony/lib/core/class.arrayserializer.php - About 1 hr 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 hash has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function hash($input, array $options = [])
        {
            if (empty($options['salt'])) {
                $salt = self::generateSalt(self::SALT_LENGTH);
            } else {
    Severity: Minor
    Found in symphony/lib/toolkit/cryptography/class.pbkdf2.php - About 1 hr 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 setSettings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function setSettings(array $settings = array())
        {
            // Date format
            if (isset($settings['date_format'])) {
                self::$settings['date_format'] = $settings['date_format'];
    Severity: Minor
    Found in symphony/lib/core/class.datetimeobj.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function view()
        {
            $sort = General::sanitize($_REQUEST['sort']);
            $sections = (new SectionManager)
                ->select()
    Severity: Minor
    Found in symphony/content/content.ajaxsections.php - About 1 hr 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 order has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            $(document).on('mousemove.orderable', '.orderable:has(.ordering)', function order(event) {
                var object = $(this);
                if (object.data('ordering') != 1) {
                    return;
                }
    Severity: Minor
    Found in symphony/assets/js/src/symphony.orderable.js - About 1 hr to fix

      Method __process has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function __process(XSLTProcessor $XSLProc, $xml, $xsl, array $parameters = array())
          {
              // Create instances of the DOMDocument class
              $xmlDoc = new DOMDocument;
              $xslDoc = new DOMDocument;
      Severity: Minor
      Found in symphony/lib/toolkit/class.xsltprocess.php - About 1 hr to fix

        Method createSectionAssociation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function createSectionAssociation($parent_section_id = null, $child_field_id = null, $parent_field_id = null, $show_association = true, $interface = null, $editor = null)
            {
                if (is_null($parent_section_id) && (is_null($parent_field_id) || !$parent_field_id)) {
                    return false;
                }
        Severity: Minor
        Found in symphony/lib/toolkit/class.sectionmanager.php - About 1 hr to fix

          Function attachMessage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  objects.on('attach.notify', function attachMessage(event, message, type) {
                      var object = $(this),
                          notifier = object.find('div.notifier'),
                          items = notifier.find(settings.items),
                          item, storage;
          Severity: Minor
          Found in symphony/assets/js/src/symphony.notify.js - About 1 hr to fix

            Method setDataFromPost has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function setDataFromPost($data, &$errors = null, $simulate = false, $ignore_missing_fields = false)
                {
                    $status = Entry::__ENTRY_OK__;
            
                    // Entry has no ID, create it:
            Severity: Minor
            Found in symphony/lib/toolkit/class.entry.php - About 1 hr to fix

              Function pick has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      objects.on('change.pickable', function pick() {
                          var object = $(this),
                              choice = object.val(),
                              relation = object.attr('id') || object.attr('name'),
                              related = $(settings.pickables + '[data-relation="' + relation + '"]'),
              Severity: Minor
              Found in symphony/assets/js/src/symphony.pickable.js - About 1 hr to fix

                Method fetchFilterableOperators has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function fetchFilterableOperators()
                    {
                        return array(
                            array(
                                'title' => 'is',
                Severity: Minor
                Found in symphony/lib/toolkit/class.field.php - About 1 hr to fix

                  Method createHandle has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function createHandle($string, $max_length = 255, $delim = '-', $uriencode = false, $additional_rule_set = null)
                      {
                          // If empty, bail out quick
                          if (empty(trim($string))) {
                              return '';
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.general.php - About 1 hr to fix

                    Method fetch has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function fetch($sortby = 'id', $sortdirection = 'ASC', $limit = null, $start = null, $where = null, $joins = null)
                        {
                            if (Symphony::Log()) {
                                Symphony::Log()->pushDeprecateWarningToLog('AuthorManager::fetch()', 'AuthorManager::select()');
                            }
                    Severity: Minor
                    Found in symphony/lib/toolkit/class.authormanager.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language