eveseat/installer

View on GitHub

Showing 17 of 126 total issues

File PackageInstaller.php has 316 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
 * This file is part of SeAT
 *
Severity: Minor
Found in src/Utils/PackageInstaller.php - About 3 hrs to fix

    Method alt_stat has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function alt_stat($file)
        {
    
            clearstatcache();
            $ss = @stat($file);
    Severity: Major
    Found in src/helpers.php - About 2 hrs to fix

      Function findSeatInstallation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function findSeatInstallation(): string
          {
      
              $fs = new Filesystem();
      
      
      Severity: Minor
      Found in src/Traits/FindsSeatInstallations.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 configureMySql has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function configureMySql()
          {
      
              $mysql = new MySql($this->io);
      
      
      Severity: Minor
      Found in src/Commands/Install/Production.php - About 1 hr to fix

        Method configure has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function configure(string $path)
            {
                $this->io->text('Writing the Nginx Server block configuration');
        
                // Get the OS that will be used to determine where the config will be
        Severity: Minor
        Found in src/Utils/Nginx.php - About 1 hr to fix

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

              public function checkPhpRequirements(): bool
              {
          
                  if (version_compare(phpversion(), '7.1', '<')) {
          
          
          Severity: Minor
          Found in src/Utils/Requirements.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 checkCommandRequirements has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function checkCommandRequirements(array $commands = null)
              {
          
                  // Map the executables from the function argument if needed
                  if ($commands)
          Severity: Minor
          Found in src/Utils/Requirements.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 configure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function configure(string $path)
              {
          
                  $this->io->text('Writing the Apache Virtual Host configuration');
          
          
          Severity: Minor
          Found in src/Utils/Apache.php - About 1 hr to fix

            Method execute has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output)
                {
            
                    // Bind the input and output for later use in other methods.
                    $this->io = new SymfonyStyle($input, $output);
            Severity: Minor
            Found in src/Commands/Install/Development.php - About 1 hr to fix

              Function getOperatingSystem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getOperatingSystem(): array
                  {
              
                      $fs = new Filesystem();
              
              
              Severity: Minor
              Found in src/Traits/DetectsOperatingSystem.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 execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output)
                  {
              
                      $this->io = new SymfonyStyle($input, $output);
                      $this->io->title('SeAT Installer');
              Severity: Minor
              Found in src/Commands/Install/Production.php - About 1 hr to fix

                Method checkPermissions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function checkPermissions()
                    {
                
                        $this->io->text('Checking filesystem permissions');
                
                
                Severity: Minor
                Found in src/Commands/Diagnose.php - About 1 hr to fix

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

                      public function configure(string $path)
                      {
                          $this->io->text('Writing the Nginx Server block configuration');
                  
                          // Get the OS that will be used to determine where the config will be
                  Severity: Minor
                  Found in src/Utils/Nginx.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 configureMySql has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function configureMySql()
                      {
                  
                          $mysql = new MySql($this->io);
                  
                  
                  Severity: Minor
                  Found in src/Commands/Install/Production.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 checkPermissions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function checkPermissions()
                      {
                  
                          $this->io->text('Checking filesystem permissions');
                  
                  
                  Severity: Minor
                  Found in src/Commands/Diagnose.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 getWebserver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getWebserver()
                      {
                  
                          $fs = new Filesystem();
                  
                  
                  Severity: Minor
                  Found in src/Traits/DetectsWebserver.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 configure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function configure(string $path)
                      {
                  
                          $this->io->text('Writing the Apache Virtual Host configuration');
                  
                  
                  Severity: Minor
                  Found in src/Utils/Apache.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

                  Severity
                  Category
                  Status
                  Source
                  Language