symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Method isTextFormatterUsed has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function isTextFormatterUsed($text_formatter_handle)
    {
        $fields = Symphony::Database()
            ->select(['type'])
            ->distinct()
Severity: Minor
Found in symphony/lib/toolkit/class.fieldmanager.php - About 1 hr to fix

    Method prepareExportValue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function prepareExportValue($data, $mode, $entry_id = null)
        {
            $modes = (object)$this->getExportModes();
    
            if (isset($data['handle']) && is_array($data['handle']) === false) {
    Severity: Minor
    Found in symphony/lib/toolkit/fields/field.taglist.php - About 1 hr to fix

      Method prepareExportValue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function prepareExportValue($data, $mode, $entry_id = null)
          {
              $modes = (object)$this->getExportModes();
      
              // Make sure we have an array to work with:
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.author.php - About 1 hr to fix

        Method displaySettingsPanel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
            {
                parent::displaySettingsPanel($wrapper, $errors);
        
                // Destination Folder
        Severity: Minor
        Found in symphony/lib/toolkit/fields/field.upload.php - About 1 hr to fix

          Method resolvePage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function resolvePage($page_id, $column)
              {
                  $query = (new PageManager)
                      ->select(['p.parent', "p.$column"])
                      ->limit(1);
          Severity: Minor
          Found in symphony/lib/toolkit/class.pagemanager.php - About 1 hr to fix

            Method loginFromToken has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function loginFromToken($token)
                {
                    $token = trim($token);
            
                    if (strlen($token) === 0) {
            Severity: Minor
            Found in symphony/lib/core/class.symphony.php - About 1 hr to fix

              Method insertBreadcrumbsUsingPageIdentifier has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function insertBreadcrumbsUsingPageIdentifier($page_id, $preserve_last = true)
                  {
                      if ($page_id == 0) {
                          return $this->insertBreadcrumbs(
                              array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'))
              Severity: Minor
              Found in symphony/content/content.blueprintspages.php - About 1 hr to fix

                Method write has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function write($id, $data)
                    {
                        // Only prevent this record from saving if there isn't already a record
                        // in the database. This prevents empty Sessions from being created, but
                        // allows them to be nulled.
                Severity: Minor
                Found in symphony/lib/core/class.session.php - About 1 hr to fix

                  Function viewSuccess has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function viewSuccess()
                      {
                          $this->Form->setAttribute('action', SYMPHONY_URL);
                  
                          $h2 = new XMLElement('h2', __('Updating Complete'));
                  Severity: Minor
                  Found in install/lib/class.updaterpage.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function validate()
                      {
                          if (strlen(trim($this->_subject)) <= 0) {
                              throw new EmailValidationException(__('Email subject cannot be empty.'));
                          } elseif (strlen(trim($this->_sender_email_address)) <= 0) {
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.emailgateway.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 validateSQLQuery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      final public function validateSQLQuery($query, $strict = true)
                      {
                          if (
                              strpos($query, '\'--') !== false || strpos($query, '\';--') !== false ||
                              strpos($query, '\' --') !== false || strpos($query, '\'/*') !== false
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.database.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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function create($name)
                      {
                          if (!isset(self::$_pool[$name])) {
                              $classname = self::__getClassName($name);
                              $path = self::__getDriverPath($name);
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.extensionmanager.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 finalize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function finalize()
                      {
                          // Get a flatten projection
                          $projection = $this->getSQLParts('projection');
                          General::flattenArray($projection);
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.entryquery.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 read has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function read($hash, $namespace = null)
                      {
                          $data = false;
                          $query = $this->Database
                              ->select()
                  Severity: Minor
                  Found in symphony/lib/toolkit/cache/cache.database.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 prepareExportValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function prepareExportValue($data, $mode, $entry_id = null)
                      {
                          $modes = (object)$this->getExportModes();
                  
                          // Export handles:
                  Severity: Minor
                  Found in symphony/lib/toolkit/fields/field.textarea.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 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
                      {
                          if (!$data) {
                              // TODO: Don't rely on $_POST
                              if (isset($_POST) && !empty($_POST)) {
                  Severity: Minor
                  Found in symphony/lib/toolkit/fields/field.checkbox.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 login has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function login($username, $password, $isHash = false)
                      {
                          $username = trim($username);
                          $password = trim($password);
                  
                  
                  Severity: Minor
                  Found in symphony/lib/core/class.symphony.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 sendHeaders has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function sendHeaders($e)
                      {
                          if (!headers_sent()) {
                              cleanup_session_cookies();
                  
                  
                  Severity: Minor
                  Found in symphony/lib/core/class.exceptionrenderer.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 getPageNamespace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getPageNamespace()
                      {
                          if (self::$namespace !== false) {
                              return self::$namespace;
                          }
                  Severity: Minor
                  Found in symphony/lib/core/class.symphony.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 filter has a Cognitive Complexity of 10 (exceeds 5 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.entryqueryauthoradapter.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

                  Severity
                  Category
                  Status
                  Source
                  Language