symphonycms/symphony-2

View on GitHub

Showing 844 of 844 total issues

Function translate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function translate($string, array $inserts = null, $namespace = null)
    {
        if (!$namespace) {
            $namespace = Symphony::getPageNamespace();
        }
Severity: Minor
Found in symphony/lib/toolkit/class.lang.php - About 25 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 fetchByID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fetchByID($id)
    {
        $return_single = false;

        if (is_null($id)) {
Severity: Minor
Found in symphony/lib/toolkit/class.authormanager.php - About 25 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 writeFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function writeFile($file, $data, $perm = 0644, $mode = 'w', $trim = false)
    {
        if (static::checkFileWritable($file) === false) {
            return false;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.general.php - About 25 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 limitWords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function limitWords($string, $maxChars = 200, $appendHellip = false)
    {
        if ($appendHellip) {
            $maxChars -= 1;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.general.php - About 25 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 setAttachments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setAttachments($files)
    {
        // Always erase
        $this->_attachments = array();

Severity: Minor
Found in symphony/lib/toolkit/class.emailgateway.php - About 25 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 enable has a Cognitive Complexity of 6 (exceeds 5 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 25 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 sortByAuthor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function sortByAuthor($a, $b, $i = 0)
    {
        $first = $a;
        $second = $b;

Severity: Minor
Found in symphony/lib/toolkit/class.extensionmanager.php - About 25 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 mergeFilePostData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function mergeFilePostData($type, array $file, array &$post)
    {
        foreach ($file as $key => $value) {
            if (!isset($post[$key])) {
                $post[$key] = array();
Severity: Minor
Found in symphony/lib/toolkit/class.general.php - About 25 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 createFilterRegexp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createFilterRegexp($filter, array $columns)
    {
        $field_id = General::intval($this->field->get('id'));
        $filter = $this->field->cleanValue($filter);
        $pattern = '';
Severity: Minor
Found in symphony/lib/toolkit/class.entryqueryfieldadapter.php - About 25 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 6 (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/fields/field.textarea.php - About 25 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 prepareExportValue has a Cognitive Complexity of 6 (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.input.php - About 25 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 attach has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function attach($type, $r_handle, $page_id)
    {
        $col = self::getColumnFromType($type);

        $page = (new PageManager)->select([$col])->page($page_id)->execute()->next();
Severity: Minor
Found in symphony/lib/toolkit/class.resourcemanager.php - About 25 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 __switchboard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __switchboard($type = 'view')
    {
        if (!isset($this->_context['action']) || trim($this->_context['action']) === '') {
            $action = 'index';
        } else {
Severity: Minor
Found in symphony/lib/toolkit/class.administrationpage.php - About 25 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 getTemplate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTemplate($name)
    {
        $format = '%s/%s.tpl';

        if (!ExceptionHandler::$enabled && php_sapi_name() !== 'cli') {
Severity: Minor
Found in symphony/lib/core/class.exceptionrenderer.php - About 25 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 countProjection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function countProjection($col = '*')
    {
        $ignoredParts = ['statement', 'optimizer', 'cache', 'projection', 'order by', 'limit', 'offset'];
        $cp = new DatabaseQuery($this->getDB(), ["COUNT($col)"]);
        foreach ($this->getSQL() as $part) {
Severity: Minor
Found in symphony/lib/toolkit/class.databasequery.php - About 25 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 editPageChildren has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function editPageChildren($page_id = null, $page_path = null)
    {
        if (!is_int($page_id)) {
            return false;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.pagemanager.php - About 25 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 getTimezonesSelectOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTimezonesSelectOptions($selected = null)
    {
        $zones = self::getZones();
        $groups = array();

Severity: Minor
Found in symphony/lib/core/class.datetimeobj.php - About 25 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 buildPageXML has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildPageXML($page, $page_types)
    {
        $oPage = new XMLElement('page');
        $oPage->setAttribute('handle', $page['handle']);
        $oPage->setAttribute('id', $page['id']);
Severity: Minor
Found in symphony/lib/toolkit/data-sources/class.datasource.navigation.php - About 25 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 Engine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function Engine()
    {
        if (defined('APP_MODE') && APP_MODE === 'administration') {
            return Administration::instance();
        } elseif (defined('APP_MODE') && APP_MODE === 'frontend') {
Severity: Minor
Found in symphony/lib/core/class.symphony.php - About 25 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 __getDSParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function __getDSParams()
    {
        $params = array();
        $datasources = DatasourceManager::listAll();

Severity: Minor
Found in symphony/content/content.ajaxparameters.php - About 25 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