symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Function prepareExportValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepareExportValue($data, $mode, $entry_id = null)
    {
        $modes = (object)$this->getExportModes();

        $filepath = $this->getFilePath($data['file']);
Severity: Minor
Found in symphony/lib/toolkit/fields/field.upload.php - About 35 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 buildRangeFilterSQL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildRangeFilterSQL($data, &$joins, &$where, $andOperation = false)
    {
        $field_id = $this->get('id');

        if (empty($data)) {
Severity: Minor
Found in symphony/lib/toolkit/fields/field.date.php - About 35 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 displayPublishPanel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
    {
        $states = $this->getToggleStates();
        $value = isset($data['value']) ? $data['value'] : null;

Severity: Minor
Found in symphony/lib/toolkit/fields/field.select.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepareExportValue($data, $mode, $entry_id = null)
    {
        $modes = (object)$this->getExportModes();

        if (isset($data['handle']) && is_array($data['handle']) === false) {
Severity: Minor
Found in symphony/lib/toolkit/fields/field.select.php - About 35 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 resolvePage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function resolvePage($page_id, $column)
    {
        $query = (new PageManager)
            ->select(['p.parent', "p.$column"])
            ->limit(1);
Severity: Minor
Found in symphony/lib/toolkit/class.pagemanager.php - About 35 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 validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validate($string)
    {
        try {
            if (is_numeric($string) && (int)$string == $string) {
                $date = new DateTime('@' . $string);
Severity: Minor
Found in symphony/lib/core/class.datetimeobj.php - About 35 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 acquire has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function acquire($id, $ttl = 5, $path = '.')
    {
        $lockFile = self::__generateLockFileName($id, $path);

        // If this thread already has acquired the lock, return true.
Severity: Minor
Found in symphony/lib/toolkit/class.mutex.php - About 35 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 pushToLog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function pushToLog($message, $type = E_NOTICE, $writeToLog = false, $addbreak = true, $append = false)
    {
        if (!$type) {
            $type = E_ERROR;
        }
Severity: Minor
Found in symphony/lib/core/class.log.php - About 35 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 __shutdownCleanup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function __shutdownCleanup()
    {
        $now = time();

        if (is_array(self::$lockFiles)) {
Severity: Minor
Found in symphony/lib/toolkit/class.mutex.php - About 35 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 edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function edit($page_id, array $fields, $delete_types = false)
    {
        if (!is_numeric($page_id)) {
            return false;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.pagemanager.php - About 35 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 _process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function _process($data, DOMElement $element)
    {
        if (is_array($data)) {
            foreach ($data as $item) {
                $item_element = self::_process($item, self::$dom->createElement('item'));
Severity: Minor
Found in symphony/lib/toolkit/class.json.php - About 35 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 commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function commit()
    {
        if (!Field::commit()) {
            return false;
        }
Severity: Minor
Found in symphony/lib/toolkit/fields/field.select.php - About 35 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 commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function commit()
    {
        if (!is_null($this->get('id'))) {
            $id = $this->get('id');
            $this->remove('id');
Severity: Minor
Found in symphony/lib/toolkit/class.author.php - About 35 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 appendBodyAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function appendBodyAttributes(array $context = array())
    {
        foreach ($context as $key => $value) {
            if (is_numeric($value)) {
                $key = 'id';
Severity: Minor
Found in symphony/lib/toolkit/class.administrationpage.php - About 35 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 parseParamURL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseParamURL($url = null)
    {
        if (!isset($url)) {
            return null;
        }
Severity: Minor
Found in symphony/lib/toolkit/class.datasource.php - About 35 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 setArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setArray(array $array, $overwrite = false)
    {
        if ($overwrite) {
            $this->_properties = array_merge($this->_properties, $array);
        } else {
Severity: Minor
Found in symphony/lib/core/class.configuration.php - About 35 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 insertBreadcrumbsUsingPageIdentifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function insertBreadcrumbsUsingPageIdentifier($page_id, $preserve_last = true)
    {
        if ($page_id == 0) {
            return $this->insertBreadcrumbs(
                array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'))
Severity: Minor
Found in symphony/content/content.blueprintspages.php - About 35 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

Avoid too many return statements within this method.
Open

        return $this->createFilterEquality($filter, $this->getFilterColumns());
Severity: Major
Found in symphony/lib/toolkit/class.entryquerylistadapter.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return false;
    Severity: Major
    Found in symphony/lib/toolkit/class.event.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $this->buildWhereClauseFromArray($conditions);
      Severity: Major
      Found in symphony/lib/toolkit/trait.databasewheredefinition.php - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language