symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Method fetch has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
Severity: Major
Found in symphony/lib/toolkit/class.fieldmanager.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                if (
                    ($file == '.' || $file == '..')
                    || ($ignore_hidden && $file{0} == '.')
                    || !is_dir("$dir/$file")
                    || in_array($file, $exclude)
    Severity: Major
    Found in symphony/lib/toolkit/class.general.php - About 1 hr to fix

      Function column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function column($col)
          {
              if (!is_string($col) && !is_int($col)) {
                  throw new Exception('`$col must be a string or an integer');
              }
      Severity: Minor
      Found in symphony/lib/toolkit/class.arrayreducer.php - About 55 mins 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 findDefaultData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function findDefaultData()
          {
              $section = (new SectionManager)->select()->section($this->get('section_id'))->execute()->next();
              $schema = $section->fetchFields();
      
      
      Severity: Minor
      Found in symphony/lib/toolkit/class.entry.php - About 55 mins 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 rowsIndexedByColumn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rowsIndexedByColumn($col)
          {
              if (!is_string($col) && !is_int($col)) {
                  throw new Exception('`$col must be a string or an integer');
              }
      Severity: Minor
      Found in symphony/lib/toolkit/class.arrayreducer.php - About 55 mins 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 isTextFormatterUsed has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 9 (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/class.field.php - About 55 mins 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 getAvailableMigrations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getAvailableMigrations($version = null)
          {
              $migrations = [];
              if (!$version) {
                  $version = Symphony::Configuration()->get('version', 'symphony');
      Severity: Minor
      Found in install/lib/class.updater.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function send()
          {
              $this->validate();
      
              try {
      Severity: Minor
      Found in symphony/lib/toolkit/email-gateways/email.sendmail.php - About 55 mins 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 getMimeType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getMimeType($file)
          {
              if (!empty($file)) {
                  // in PHP 5.3 we can use 'finfo'
                  if (PHP_VERSION_ID >= 50300 && function_exists('finfo_open')) {
      Severity: Minor
      Found in symphony/lib/toolkit/class.general.php - About 55 mins 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 flattenArray has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function flattenArray(array &$source, &$output = null, $path = null)
          {
              if (is_null($output)) {
                  $output = array();
              }
      Severity: Minor
      Found in symphony/lib/toolkit/class.general.php - About 55 mins 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 createHandle has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 groupRecords has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function groupRecords($records)
          {
              if (!is_array($records) || empty($records)) {
                  return;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.date.php - About 55 mins 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 prepareImportValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function prepareImportValue($data, $mode, $entry_id = null)
          {
              $value = $status = $message = null;
              $modes = (object)$this->getImportModes();
      
      
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.date.php - About 55 mins 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 groupRecords has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function groupRecords($records)
          {
              if (!is_array($records) || empty($records)) {
                  return;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.author.php - About 55 mins 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 displaySettingsPanel has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 replaceFieldToken has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function replaceFieldToken($needle, $haystack, $default = null, $discard_field_name = true, $collapse = true)
          {
              if (preg_match('/^(fields\[[^\]]+\],?)+$/i', $needle)) {
                  $parts = preg_split('/\,/i', $needle, -1, PREG_SPLIT_NO_EMPTY);
                  $parts = array_map('trim', $parts);
      Severity: Minor
      Found in symphony/lib/toolkit/events/class.event.section.php - About 55 mins 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 getToggleStates has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getToggleStates()
          {
              if (!is_array($this->get('pre_populate_source'))) {
                  return;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.taglist.php - About 55 mins 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 processPreSaveFilters has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 renderHtml has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function renderHtml($e)
          {
              $heading = $e instanceof ErrorException ? ErrorHandler::$errorTypeStrings[$e->getSeverity()] : 'Fatal Error';
              $message = $e->getMessage() . ($e->getPrevious()
                  ? '<br />' . __('Previous exception: ') . $e->getPrevious()->getMessage()
      Severity: Minor
      Found in symphony/lib/core/class.exceptionrenderer.php - About 55 mins 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