symphonycms/symphony-2

View on GitHub
install/lib/class.installerpage.php

Summary

Maintainability
D
1 day
Test Coverage

Method viewConfiguration has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function viewConfiguration()
    {
        // Populating fields array
        $fields = isset($_POST['fields']) ? $_POST['fields'] : $this->params['default-config'];

Severity: Major
Found in install/lib/class.installerpage.php - About 4 hrs to fix

    File class.installerpage.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * @package content
     */
    Severity: Minor
    Found in install/lib/class.installerpage.php - About 3 hrs to fix

      Function __appendError has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          private function __appendError(array $codes, XMLElement &$element, $message = null)
          {
              if (is_null($message)) {
                  $message =  __('The following errors have been reported:');
              }
      Severity: Minor
      Found in install/lib/class.installerpage.php - About 2 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 viewSuccess has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function viewSuccess()
          {
              $symphonyUrl = URL . '/' . Symphony::Configuration()->get('admin-path', 'symphony');
              $this->Form->setAttribute('action', $symphonyUrl);
      
      
      Severity: Minor
      Found in install/lib/class.installerpage.php - About 1 hr to fix

        Method __build has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function __build($version = VERSION, XMLElement $extra = null)
            {
                parent::__build();
        
                $this->Form = Widget::Form(INSTALL_URL . '/index.php', 'post');
        Severity: Minor
        Found in install/lib/class.installerpage.php - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status