piotrpolak/pepiscms

View on GitHub
pepiscms/application/controllers/admin/Installer.php

Summary

Maintainability
D
2 days
Test Coverage

File Installer.php has 400 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * PepisCMS
 *
Severity: Minor
Found in pepiscms/application/controllers/admin/Installer.php - About 5 hrs to fix

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

        public function index()
        {
            $this->installer_helper->buildFileStructure(INSTALLATIONPATH);
    
            // When the Symfony2 configuration is not present, display the native connection only
    Severity: Major
    Found in pepiscms/application/controllers/admin/Installer.php - About 2 hrs to fix

      Method features has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function features()
          {
              $_LANG_DIR = dirname(realpath(__FILE__)) . '/../../language/';
              $_THEMES_DIR = INSTALLATIONPATH . 'theme/';
      
      
      Severity: Major
      Found in pepiscms/application/controllers/admin/Installer.php - About 2 hrs to fix

        Method __construct has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct()
            {
                // Do not render menu and skip authorization
                parent::__construct(false, true);
        
        
        Severity: Minor
        Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

          Method installed_modules has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function installed_modules()
              {
                  $this->formbuilder->setTitle($this->lang->line('installer_installed_modules'));
                  $that = $this;
                  $this->formbuilder->setCallback(function ($data_array) use ($that) {
          Severity: Minor
          Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

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

                public function auth_driver()
                {
                    $auth_drivers = array(
                        'native' => $this->lang->line('installer_auth_driver_native')
                    );
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

              Method admin_account has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function admin_account()
                  {
                      if ($this->get_installation_data('authentification_driver') != 'native') {
                          redirect(admin_url() . 'installer/features');
                      }
              Severity: Minor
              Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

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

                    public function features()
                    {
                        $_LANG_DIR = dirname(realpath(__FILE__)) . '/../../language/';
                        $_THEMES_DIR = INSTALLATIONPATH . 'theme/';
                
                
                Severity: Minor
                Found in pepiscms/application/controllers/admin/Installer.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

                There are no issues that match your filters.

                Category
                Status