mageni/mageni

View on GitHub

Showing 76 of 145 total issues

Method stopScan has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function stopScan($data, $id)
    {
        /**
         * Set Permissions
         */
Severity: Minor
Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 1 hr to fix

    Method lockScan has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function lockScan($data, $id)
        {
            /**
             * Set Permissions
             */
    Severity: Minor
    Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 1 hr to fix

      Method createSMB has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function createSMB($data)
          {
              /**
               * Set Permissions
               */
      Severity: Minor
      Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 1 hr to fix

        Method modify has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function modify($id, $name, $description, $template, $target, $ordering, $maxtests, $maxhosts, $scanner, $schedule = null, $alert = null): bool
        Severity: Major
        Found in src/frontend/app/Http/Livewire/Classes/Scan.php - About 1 hr to fix

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

              public function getRowsQueryProperty()
              {
                  $this->getReport = Reports::where('task', '=', $this->task)
                      ->select('id')
                      ->orderBy('id', 'DESC')
          Severity: Minor
          Found in src/frontend/app/Http/Livewire/Reports/Page.php - About 1 hr to fix

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

                public function saveEditUser($id)
                {
                    $this->authorize('edit_users');
            
                    if($this->togglePasswordReset === 'Yes')
            Severity: Minor
            Found in src/frontend/app/Http/Livewire/UserManagement.php - About 1 hr to fix

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

                  public function thirdStepSubmit(): int
                  {
                      if($this->toggleSSHCredentials === 'Yes' ||
                          $this->toggleSSHCredentials === 'Create' || 
                          $this->toggleSSHCredentials === 'Modify' || 
              Severity: Minor
              Found in src/frontend/app/Http/Livewire/Traits/MultiStepForm.php - About 1 hr to fix

                Method passes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function passes($attribute, $value)
                    {
                        Log::info('Processing SSH Key Validation');
                
                        if(empty($value)) {
                Severity: Minor
                Found in src/frontend/app/Rules/ValidateSSHKey.php - About 1 hr to fix

                  Method create has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function create($name, $description, $template, $target, $ordering, $maxtests, $maxhosts, $scanner, $schedule = null, $alert = null): bool
                  Severity: Major
                  Found in src/frontend/app/Http/Livewire/Classes/Scan.php - About 1 hr to fix

                    Method modify has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function modify($id, $description, $targets, $ports, $alive, $exclude = null, $port_list = null, $ssh_cred = null, $ssh_port = null, $smb_cred = null)
                    Severity: Major
                    Found in src/frontend/app/Http/Livewire/Classes/Target.php - About 1 hr to fix

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

                          public function up()
                          {
                              $tableNames = config('permission.table_names');
                              $columnNames = config('permission.column_names');
                              $teams = config('permission.teams');

                      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 create has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function create($description, $targets, $ports, $alive, $exclude = null, $port_list = null, $ssh_cred = null, $ssh_port = null, $smb_cred = null)
                      Severity: Major
                      Found in src/frontend/app/Http/Livewire/Classes/Target.php - About 1 hr to fix

                        Method render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function render(Request $request)
                            {
                                // dd($request);
                        
                                return view('livewire.dashboard.page', [
                        Severity: Minor
                        Found in src/frontend/app/Http/Livewire/Dashboard/Page.php - About 1 hr to fix

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

                              public function modifyAsset($data, $id = null)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 modifyScan has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function modifyScan($data, $id = null)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 startScan has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function startScan($data, $id)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 resumeScan has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function resumeScan($data, $id)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 modifySSH has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function modifySSH($data, $id = null)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 createSSH has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function createSSH($data)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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 createAsset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function createAsset($data)
                              {
                                  /**
                                   * Set Permissions
                                   */
                          Severity: Minor
                          Found in src/frontend/app/Http/Livewire/Classes/Socket.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

                          Severity
                          Category
                          Status
                          Source
                          Language