owncloud/core

View on GitHub
lib/private/Setup.php

Summary

Maintainability
F
3 days
Test Coverage

Method install has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function install($options) {
        $l = $this->l10n;

        $error = [];
        $dbType = $options['dbtype'];
Severity: Major
Found in lib/private/Setup.php - About 5 hrs to fix

    File Setup.php has 382 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Administrator <Administrator@WINDOWS-2012>
     * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
     * @author Bart Visscher <bartv@thisnet.nl>
    Severity: Minor
    Found in lib/private/Setup.php - About 5 hrs to fix

      Function install has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public function install($options) {
              $l = $this->l10n;
      
              $error = [];
              $dbType = $options['dbtype'];
      Severity: Minor
      Found in lib/private/Setup.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 updateHtaccess has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function updateHtaccess() {
              $config = \OC::$server->getConfig();
              $il10n = \OC::$server->getL10N('lib');
      
              // For CLI read the value from overwrite.cli.url
      Severity: Major
      Found in lib/private/Setup.php - About 2 hrs to fix

        Method getSupportedDatabases has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getSupportedDatabases($allowAllDatabases = false) {
                $availableDatabases = [
                    'sqlite' =>  [
                        'type' => 'class',
                        'call' => 'SQLite3',
        Severity: Major
        Found in lib/private/Setup.php - About 2 hrs to fix

          Function getSupportedDatabases has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getSupportedDatabases($allowAllDatabases = false) {
                  $availableDatabases = [
                      'sqlite' =>  [
                          'type' => 'class',
                          'call' => 'SQLite3',
          Severity: Minor
          Found in lib/private/Setup.php - About 1 hr 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 getSystemInfo has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getSystemInfo($allowAllDatabases = false) {
                  $databases = $this->getSupportedDatabases($allowAllDatabases);
          
                  $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');
          
          
          Severity: Minor
          Found in lib/private/Setup.php - About 1 hr to fix

            Function updateHtaccess has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function updateHtaccess() {
                    $config = \OC::$server->getConfig();
                    $il10n = \OC::$server->getL10N('lib');
            
                    // For CLI read the value from overwrite.cli.url
            Severity: Minor
            Found in lib/private/Setup.php - About 1 hr 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 getSystemInfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getSystemInfo($allowAllDatabases = false) {
                    $databases = $this->getSupportedDatabases($allowAllDatabases);
            
                    $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');
            
            
            Severity: Minor
            Found in lib/private/Setup.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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    IConfig $config,
                    IniGetWrapper $iniWrapper,
                    IL10N $l10n,
                    \OC_Defaults $defaults,
                    ILogger $logger,
            Severity: Minor
            Found in lib/private/Setup.php - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status