symphonycms/symphony-2

View on GitHub
symphony/content/content.blueprintsdatasources.php

Summary

Maintainability
F
3 wks
Test Coverage

Method __form has 791 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __form()
    {
        $formHasErrors = (is_array($this->_errors) && !empty($this->_errors));

        if ($formHasErrors) {
Severity: Major
Found in symphony/content/content.blueprintsdatasources.php - About 3 days to fix

    Function __form has a Cognitive Complexity of 172 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __form()
        {
            $formHasErrors = (is_array($this->_errors) && !empty($this->_errors));
    
            if ($formHasErrors) {
    Severity: Minor
    Found in symphony/content/content.blueprintsdatasources.php - About 3 days 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

    File content.blueprintsdatasources.php has 1269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * @package content
     */
    Severity: Major
    Found in symphony/content/content.blueprintsdatasources.php - About 3 days to fix

      Function __formAction has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __formAction()
          {
              $fields = $_POST['fields'];
              $this->_errors = array();
              $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::DATASOURCE);
      Severity: Minor
      Found in symphony/content/content.blueprintsdatasources.php - About 2 days 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

      Method __formAction has 233 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __formAction()
          {
              $fields = $_POST['fields'];
              $this->_errors = array();
              $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::DATASOURCE);
      Severity: Major
      Found in symphony/content/content.blueprintsdatasources.php - About 1 day to fix

        Function __viewInfo has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __viewInfo()
            {
                $this->setPageType('form');
        
                $datasource = DatasourceManager::create($this->_context['handle'], array(), false);
        Severity: Minor
        Found in symphony/content/content.blueprintsdatasources.php - About 3 hrs 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

        Method __viewInfo has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __viewInfo()
            {
                $this->setPageType('form');
        
                $datasource = DatasourceManager::create($this->_context['handle'], array(), false);
        Severity: Major
        Found in symphony/content/content.blueprintsdatasources.php - About 2 hrs to fix

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

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

              public function __actionEdit()
              {
                  if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
                      return $this->__formAction();
                  } elseif (is_array($_POST['action']) && array_key_exists('delete', $_POST['action'])) {
          Severity: Minor
          Found in symphony/content/content.blueprintsdatasources.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

          Method __appendAuthorFilter has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __appendAuthorFilter(&$wrapper, $h4_label, $name, $value = null, $templateOnly = true)
          Severity: Minor
          Found in symphony/content/content.blueprintsdatasources.php - About 35 mins to fix

            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 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    } elseif (is_array($_POST['action']) && array_key_exists('delete', $_POST['action'])) {
                        /**
                         * Prior to deleting the Datasource file. Target file path is provided.
                         *
                         * @delegate DatasourcePreDelete
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 1 day to fix
            symphony/content/content.blueprintsevents.php on lines 382..448

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 296.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if (
                            isset($fields['filter'][$section_id]['system:id'])
                            || isset($fields['filter'][$section_id]['id'])
                        ) {
                            $id = isset($fields['filter'][$section_id]['system:id'])
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 1 day to fix
            symphony/content/content.blueprintsdatasources.php on lines 399..418

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 264.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if (
                            isset($fields['filter'][$section_id]['system:creation-date'])
                            || isset($fields['filter'][$section_id]['system:date'])
                        ) {
                            $creation_date = isset($fields['filter'][$section_id]['system:creation-date'])
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 1 day to fix
            symphony/content/content.blueprintsdatasources.php on lines 365..384

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 264.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

                    if ($formHasErrors) {
                        $this->pageAlert(
                            __('An error occurred while processing this form. See below for details.'),
                            Alert::ERROR
                        );
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 2 other locations - About 5 hrs to fix
            symphony/content/content.blueprintsevents.php on lines 40..67
            symphony/content/content.blueprintssections.php on lines 357..384

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 189.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (isset($fields['filter']['navigation']['type'])) {
                        $li = new XMLElement('li');
                        $li->setAttribute('class', 'unique');
                        $li->setAttribute('data-type', 'type');
                        $li->appendChild(new XMLElement('header', '<h4>' . __('Page Type') . '</h4>'));
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 4 hrs to fix
            symphony/content/content.blueprintsdatasources.php on lines 536..546

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 177.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (isset($fields['filter']['navigation']['parent'])) {
                        $li = new XMLElement('li');
                        $li->setAttribute('class', 'unique');
                        $li->setAttribute('data-type', 'parent');
                        $li->appendChild(new XMLElement('header', '<h4>' . __('Parent Page') . '</h4>'));
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 4 hrs to fix
            symphony/content/content.blueprintsdatasources.php on lines 568..578

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 177.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public function __viewIndex($resource_type)
                {
                    parent::__viewIndex(ResourceManager::RESOURCE_TYPE_DS);
            
                    $this->setTitle(__('%1$s &ndash; %2$s', array(__('Data Sources'), __('Symphony'))));
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 2 hrs to fix
            symphony/content/content.blueprintsevents.php on lines 13..19

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 136.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (trim($fields['name']) == '') {
                        $this->_errors['name'] = __('This is a required field');
                    } elseif (strpos($fields['name'], '\\') !== false) {
                        $this->_errors['name'] = __('This field contains invalid characters') . ' (\\)';
                    } elseif (!preg_match('/^\p{L}/u', $fields['name'])) {
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 2 hrs to fix
            symphony/content/content.blueprintsevents.php on lines 463..469

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 129.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if (strlen(trim($fields['max_records'])) == 0 || (is_numeric($fields['max_records']) && $fields['max_records'] < 1)) {
                            if ($fields['paginate_results'] === 'yes') {
                                $this->_errors['max_records'] = __('A result limit must be set');
                            }
                        } elseif (!self::__isValidPageString($fields['max_records'])) {
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 2 hrs to fix
            symphony/content/content.blueprintsdatasources.php on lines 1215..1221

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 124.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if (strlen(trim($fields['page_number'])) == 0 || (is_numeric($fields['page_number']) && $fields['page_number'] < 1)) {
                            if ($fields['paginate_results'] === 'yes') {
                                $this->_errors['page_number'] = __('A page number must be set');
                            }
                        } elseif (!self::__isValidPageString($fields['page_number'])) {
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 2 hrs to fix
            symphony/content/content.blueprintsdatasources.php on lines 1207..1213

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 124.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if ($this->_context['action'] === 'new' && is_file($file)) {
                        $isDuplicate = true;
                    } elseif ($this->_context['action'] === 'edit') {
                        $existing_handle = $this->_context['handle'];
            
            
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 2 hrs to fix
            symphony/content/content.blueprintsevents.php on lines 502..512

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 123.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public static function injectAboutInformation(&$shell, array $details)
                {
                    if (!is_array($details) || empty($details)) {
                        return;
                    }
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 1 hr to fix
            symphony/content/content.blueprintsevents.php on lines 731..744

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 118.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (isset($about['author']['website'])) {
                        $link = Widget::Anchor($about['author']['name'], General::validateURL($about['author']['website']));
                    } elseif (isset($about['author']['email'])) {
                        $link = Widget::Anchor($about['author']['name'], 'mailto:' . $about['author']['email']);
                    }
            Severity: Major
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 1 hr to fix
            symphony/lib/toolkit/class.resourcespage.php on lines 274..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 106.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if ($isEditing) {
                        $button = new XMLElement('button', __('Delete'));
                        $button->setAttributeArray(array('name' => 'action[delete]', 'class' => 'button confirm delete', 'title' => __('Delete this data source'), 'type' => 'submit', 'accesskey' => 'd', 'data-message' => __('Are you sure you want to delete this data source?')));
                        $div->appendChild($button);
                    }
            Severity: Minor
            Found in symphony/content/content.blueprintsdatasources.php and 1 other location - About 35 mins to fix
            symphony/content/content.blueprintsevents.php on lines 360..364

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 92.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            There are no issues that match your filters.

            Category
            Status