symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Function __findActiveNavigationGroup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function __findActiveNavigationGroup(array &$nav, $pageroot, $pattern = false)
    {
        foreach ($nav as $index => $contents) {
            if (is_array($contents['children']) && !empty($contents['children'])) {
                foreach ($contents['children'] as $item) {
Severity: Minor
Found in symphony/lib/toolkit/class.administrationpage.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 fetch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('PageManager::fetch()', 'PageManager::select()');
        }
Severity: Minor
Found in symphony/lib/toolkit/class.pagemanager.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 __getClassPath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function __getClassPath($handle)
    {
        if (is_file(TEXTFORMATTERS . "/formatter.$handle.php")) {
            return TEXTFORMATTERS;
        } else {
Severity: Minor
Found in symphony/lib/toolkit/class.textformattermanager.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 next has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function next()
    {
        $next = parent::next();
        if ($next) {
            // If this fields does not match the restriction, fetch the next one.
Severity: Minor
Found in symphony/lib/toolkit/class.fieldqueryresult.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 __getClassPath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function __getClassPath($handle)
    {
        if (is_file(EVENTS . "/event.$handle.php")) {
            return EVENTS;
        } else {
Severity: Minor
Found in symphony/lib/toolkit/class.eventmanager.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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function view()
    {
        $database = Symphony::Configuration()->get('db', 'database');
        $field_ids = array_map(array('General','intval'), explode(',', General::sanitize($_GET['field_id'])));
        $search = General::sanitize($_GET['query']);
Severity: Minor
Found in symphony/content/content.ajaxquery.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 getStatic has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function getStatic($field_id, $search = null)
    {
        $options = array();

        if (!empty($field_id)) {
Severity: Minor
Found in symphony/content/content.ajaxquery.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 action has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function action()
    {
        // Do not proceed if the config file cannot be changed
        if (General::checkFileWritable(CONFIG) === false) {
            redirect(SYMPHONY_URL . '/system/preferences/');
Severity: Minor
Found in symphony/content/content.systempreferences.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 parseDate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function parseDate($string, $direction = null, $equal_to = false)
    {
        $parts = array(
            'start' => null,
            'end' => null
Severity: Minor
Found in symphony/lib/toolkit/fields/field.date.php - About 1 hr to fix

    Method filter has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function filter(EntryQuery $query, array $filters, $operator = 'or')
        {
            General::ensureType([
                'operator' => ['var' => $operator, 'type' => 'string'],
            ]);
    Severity: Minor
    Found in symphony/lib/toolkit/class.entryqueryfieldadapter.php - About 1 hr to fix

      Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function execute(array &$param_pool = null)
          {
              $result = new XMLElement($this->dsParamROOTELEMENT);
      
              // Build the query
      Severity: Minor
      Found in symphony/lib/toolkit/data-sources/class.datasource.navigation.php - About 1 hr to fix

        Method addSendMailFilterDoc has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function addSendMailFilterDoc(array &$doc_parts, $filters)
            {
                if ($this->hasSendEmailFilter($filters)) {
                    $doc_parts[] = new XMLElement('h3', __('Send Notification Email'));
                    $doc_parts[] = new XMLElement('p',
        Severity: Minor
        Found in symphony/content/content.ajaxeventdocumentation.php - About 1 hr to fix

          Function symphonyAffix has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.symphonyAffix = function(options) {
                  var objects = $(this),
                      settings = {
                          // public
                          container: null,
          Severity: Minor
          Found in symphony/assets/js/src/symphony.affix.js - About 1 hr to fix

            Method cleanup_session_cookies has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function cleanup_session_cookies()
            {
                /*
                Unfortunately there is no way to delete a specific previously set cookie from PHP.
                The only way seems to be the method employed here: store all the cookie we need to keep, then delete every cookie and add the stored cookies again.
            Severity: Minor
            Found in symphony/lib/boot/func.utilities.php - About 1 hr to fix

              Method notifyMembers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function notifyMembers($delegate, $page, array $context = array())
                  {
                      // Make sure $page is an array
                      if (!is_array($page)) {
                          $page = array($page);
              Severity: Minor
              Found in symphony/lib/toolkit/class.extensionmanager.php - About 1 hr to fix

                Method processEvents has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function processEvents($events, XMLElement &$wrapper)
                    {
                        /**
                         * Manipulate the events array and event element wrapper
                         * @delegate FrontendProcessEvents
                Severity: Minor
                Found in symphony/lib/toolkit/class.frontendpage.php - About 1 hr to fix

                  Method createTable has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function createTable()
                      {
                          return Symphony::Database()
                              ->create('tbl_entries_data_' . General::intval($this->get('id')))
                              ->ifNotExists()
                  Severity: Minor
                  Found in symphony/lib/toolkit/fields/field.upload.php - About 1 hr to fix

                    Method displayPublishPanel has 34 lines of code (exceeds 25 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

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

                          public static function fetch($include_types = true, array $select = array(), array $where = array(), $order_by = null, $hierarchical = false)
                          {
                              if (Symphony::Log()) {
                                  Symphony::Log()->pushDeprecateWarningToLog('PageManager::fetch()', 'PageManager::select()');
                              }
                      Severity: Minor
                      Found in symphony/lib/toolkit/class.pagemanager.php - About 1 hr to fix

                        Method addTimestampValidationPageAlert has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function addTimestampValidationPageAlert($errorMessage, $existingObject, $action)
                            {
                                $authorId = $existingObject->get('modification_author_id');
                                if (!$authorId) {
                                    $authorId = $existingObject->get('author_id');
                        Severity: Minor
                        Found in symphony/lib/toolkit/class.administrationpage.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language