symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

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

        public function __construct($host = '127.0.0.1', $port = null, $options = array())
        {
            if ($options['secure'] !== null) {
                switch (strtolower($options['secure'])) {
                    case 'tls':
    Severity: Minor
    Found in symphony/lib/toolkit/class.smtp.php - About 1 hr to fix

      Method buildRegexSQL has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function buildRegexSQL($filter, array $columns, &$joins, &$where)
          {
              if (Symphony::Log()) {
                  Symphony::Log()->pushDeprecateWarningToLog(
                      get_called_class() . '::buildRegexSQL()',
      Severity: Minor
      Found in symphony/lib/toolkit/class.field.php - About 1 hr to fix

        Method Select has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function Select($name, array $options = null, array $attributes = null)
            {
                General::ensureType(array(
                    'name' => array('var' => $name, 'type' => 'string')
                ));
        Severity: Minor
        Found in symphony/lib/toolkit/class.widget.php - About 1 hr to fix

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

            Method throwDatabaseError has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function throwDatabaseError(Exception $ex = null)
                {
                    if (isset($ex) && $ex) {
                        $msg = $ex->getMessage();
                        $errornum = (int)$ex->getCode();
            Severity: Minor
            Found in symphony/lib/toolkit/class.database.php - About 1 hr to fix

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

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

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

                  Method displayPublishPanel has 33 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)
                      {
                          $name = $this->get('element_name');
                          $value = null;
                  
                  
                  Severity: Minor
                  Found in symphony/lib/toolkit/fields/field.date.php - About 1 hr to fix

                    Method processPreSaveFilters has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function processPreSaveFilters(XMLElement $result, array &$fields, XMLElement &$post_values, $entry_id = null)
                        {
                            $can_proceed = true;
                    
                            /**
                    Severity: Minor
                    Found in symphony/lib/toolkit/class.filterableevent.php - About 1 hr to fix

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

                        Method __actionIndex has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __actionIndex()
                            {
                                $checked = (is_array($_POST['items'])) ? array_keys($_POST['items']) : null;
                        
                                /**
                        Severity: Minor
                        Found in symphony/content/content.systemextensions.php - About 1 hr to fix

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

                            Method fetchFieldIDFromElementName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function fetchFieldIDFromElementName($element_name, $section_id = null)
                                {
                                    $schema_sql = Symphony::Database()
                                        ->select(['id'])
                                        ->from('tbl_fields')
                            Severity: Minor
                            Found in symphony/lib/toolkit/class.fieldmanager.php - About 1 hr to fix

                              Method enable has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function enable($name)
                                  {
                                      $obj = self::getInstance($name);
                              
                                      // If not installed, install it
                              Severity: Minor
                              Found in symphony/lib/toolkit/class.extensionmanager.php - About 1 hr to fix

                                Method buildField has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function buildField(array $row)
                                    {
                                        if (!isset($row['id'], $row['type'])) {
                                            return $row;
                                        }
                                Severity: Minor
                                Found in symphony/lib/toolkit/class.fieldqueryresult.php - About 1 hr to fix

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

                                      public static function generateNonce($length = 30)
                                      {
                                          $random = null;
                                          if ($length < 1) {
                                              throw new Exception('$length must be greater than 0');
                                  Severity: Minor
                                  Found in symphony/lib/toolkit/class.xsrf.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 checkRequirements has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private function checkRequirements()
                                      {
                                          $errors = [];
                                          $phpVc = new VersionComparator(phpversion());
                                  
                                  
                                  Severity: Minor
                                  Found in install/lib/class.installer.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 renderHeaders has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function renderHeaders()
                                      {
                                          // When the request was made using HTTP 1.0 and the Cache Control header
                                          // was set to 'no-cache', add the Pragma and Expires headers. RE: #2205.
                                          // Thanks to Symfony HttpFoundation for the idea as well.
                                  Severity: Minor
                                  Found in symphony/lib/toolkit/class.page.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 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static function fetch($section_id = null, $order = 'ASC', $sortfield = 'name')
                                      {
                                          if (Symphony::Log()) {
                                              Symphony::Log()->pushDeprecateWarningToLog('SectionManager::fetch()', 'SectionManager::select()');
                                          }
                                  Severity: Minor
                                  Found in symphony/lib/toolkit/class.sectionmanager.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