symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

    public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
    {
        Field::displaySettingsPanel($wrapper, $errors);

        $div = new XMLElement('div', null, array('class' => 'two columns'));
Severity: Minor
Found in symphony/lib/toolkit/fields/field.select.php - About 1 hr to fix

    Method filter has 37 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.entryqueryauthoradapter.php - About 1 hr to fix

      Method processParametersInString has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function processParametersInString($value, array $env, $includeParenthesis = true, $escape = false)
          {
              if (trim($value) == '') {
                  return null;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/class.datasource.php - About 1 hr to fix

        Method __build has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function __build($version = VERSION, XMLElement $extra = null)
            {
                parent::__build();
        
                $this->Form = Widget::Form(INSTALL_URL . '/index.php', 'post');
        Severity: Minor
        Found in install/lib/class.installerpage.php - About 1 hr to fix

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

              public function generate($indent = false, $tabDepth = 0)
              {
                  $result = null;
                  $newline = ($indent ? PHP_EOL : null);
                  $addedNewline = false;
          Severity: Minor
          Found in symphony/lib/toolkit/class.xmlelement.php - About 1 hr to fix

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

              Method buildSectionNavigation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function buildSectionNavigation(&$nav)
                  {
                      // Build the section navigation, grouped by their navigation groups
                      $sections = (new SectionManager)->select()->sort('sortorder')->execute()->rows();
              
              
              Severity: Minor
              Found in symphony/lib/toolkit/class.administrationpage.php - About 1 hr to fix

                Method buildTableHeaders has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function buildTableHeaders($columns, $sort, $order, $extra_url_params = null)
                    {
                        $aTableHead = array();
                
                        foreach ($columns as $c) {
                Severity: Minor
                Found in symphony/content/class.sortable.php - About 1 hr to fix

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

                      public static function listAll()
                      {
                          $structure = General::listStructure(TOOLKIT . '/fields', '/field.[a-z0-9_-]+.php/i', false, 'asc', TOOLKIT . '/fields');
                          $extensions = Symphony::ExtensionManager()->listInstalledHandles();
                          $types = array();
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.fieldmanager.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 send has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function send()
                      {
                          $this->validate();
                  
                          $settings = array();
                  Severity: Minor
                  Found in symphony/lib/toolkit/email-gateways/email.smtp.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($type)
                      {
                          if (is_file(TOOLKIT . "/fields/field.{$type}.php")) {
                              return TOOLKIT . '/fields';
                          } else {
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.fieldmanager.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(DATASOURCES . "/data.$handle.php")) {
                              return DATASOURCES;
                          } else {
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.datasourcemanager.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($name)
                      {
                          if (is_file(EMAILGATEWAYS . "/email.$name.php")) {
                              return EMAILGATEWAYS;
                          } else {
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.emailgatewaymanager.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 getPostData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getPostData()
                      {
                          $files = array(
                              'name'      => array(),
                              'type'      => array(),
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.general.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 prepareMessageBody has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function prepareMessageBody()
                      {
                          $attachments = $this->getSectionAttachments();
                          if ($attachments) {
                              $this->appendHeaderFields($this->contentInfoArray('multipart/mixed'));
                  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 generateOrderedSQLParts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      final public function generateOrderedSQLParts()
                      {
                          $allParts = $this->getStatementStructure();
                          $orderedParts = [];
                          foreach ($allParts as $ti => $type) {
                  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 deleteDirectory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function deleteDirectory($dir, $silent = true)
                      {
                          try {
                              if (!@file_exists($dir)) {
                                  return true;
                  Severity: Minor
                  Found in symphony/lib/toolkit/class.general.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 12 (exceeds 5 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

                  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 processSystemParameters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function processSystemParameters(Entry $entry)
                      {
                          if (!isset($this->dsParamPARAMOUTPUT)) {
                              return;
                          }
                  Severity: Minor
                  Found in symphony/lib/toolkit/data-sources/class.datasource.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 buildKeyDefinitionFromArray has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function buildKeyDefinitionFromArray($k, $options)
                      {
                          if (is_string($options)) {
                              $options = ['type' => $options];
                          } elseif (!is_array($options)) {
                  Severity: Minor
                  Found in symphony/lib/toolkit/trait.databasekeydefinition.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