symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

    public static function injectAboutInformation(&$shell, array $details)
    {
        if (!is_array($details) || empty($details)) {
            return;
        }
Severity: Minor
Found in symphony/content/content.blueprintsdatasources.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 createFieldFilters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function createFieldFilters(&$wrapper, $section)
    {
        $filters = $_GET['filter'];

        foreach ($section->fetchFilterableFields() as $field) {
Severity: Minor
Found in symphony/content/content.publish.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

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

    public static function injectFilters(&$shell, array $filters)
    {
        if (!is_array($filters) || empty($filters)) {
            return;
        }
Severity: Minor
Found in symphony/content/content.blueprintsdatasources.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 __injectAboutInformation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __injectAboutInformation(&$shell, $details)
    {
        if (!is_array($details) || empty($details)) {
            return;
        }
Severity: Minor
Found in symphony/content/content.blueprintsevents.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