mageni/mageni

View on GitHub

Showing 76 of 145 total issues

File vulnerabilitiesdetails.blade.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<div>
    <x-headers.vulnerabilities />

    <main class="py-10" wire:poll.keep-alive>
        <div class="max-w-full mx-auto pr-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-full lg:px-6">

    Method up has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method saveCreateScan has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function saveCreateScan()
          {
              $this->authorize('create_scans');
      
              /**
      Severity: Major
      Found in src/frontend/app/Http/Livewire/Scan/Page.php - About 3 hrs to fix

        Method details has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function details()
            {
                return $this->details = Results::where('results.id', '=', $this->vuln)
                    ->select(
                        'results.host',
        Severity: Major
        Found in src/frontend/app/Http/Livewire/Vulnerabilities/Page.php - About 2 hrs to fix

          Socket has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Socket
          {
              private $au_response_clean = '';
              private $xml_response;
              private $json_encode_xml;
          Severity: Minor
          Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 2 hrs to fix

            Method resetFields has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function resetFields()
                {
                    $this->currentPage = 1;
            
                    $this->reset(
            Severity: Major
            Found in src/frontend/app/Http/Livewire/Traits/Methods.php - About 2 hrs to fix

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

                  public function details()
                  {
                      return $this->details = Results::where('results.nvt', '=', $this->nvt)
                          ->select(
                              'nvts.name',
              Severity: Major
              Found in src/frontend/app/Http/Livewire/Analytics/VulnerabilitiesDetail.php - About 2 hrs to fix

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

                    public function secondStepSubmit(): int
                    {
                        if($this->toggleExcludeTargets === 'Yes')
                        {
                            $this->validate([
                Severity: Major
                Found in src/frontend/app/Http/Livewire/Traits/MultiStepForm.php - About 2 hrs to fix

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

                      public function getRowsQueryProperty()
                      {
                          $this->creationTime = KnowledgeBase::query()
                              ->select('creation_time')
                              ->orderBy('nvts.creation_time', 'DESC')
                  Severity: Major
                  Found in src/frontend/app/Http/Livewire/Kb/Page.php - About 2 hrs to fix

                    Method getRowsCSVProperty has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getRowsCSVProperty()
                        {
                            $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 2 hrs to fix

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

                          public function details()
                          {
                              return $this->details = KnowledgeBase::where('nvts.uuid', '=', $this->uuid)
                                  ->select(
                                      'nvts.name',
                      Severity: Minor
                      Found in src/frontend/app/Http/Livewire/KbDetails/Page.php - About 1 hr to fix

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

                            public function secondStepSubmit(): int
                            {
                                if($this->toggleExcludeTargets === 'Yes')
                                {
                                    $this->validate([
                        Severity: Minor
                        Found in src/frontend/app/Http/Livewire/Traits/MultiStepForm.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 resumeScan has 41 lines of code (exceeds 25 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

                          Method startScan has 40 lines of code (exceeds 25 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

                            Method modifyAsset has 40 lines of code (exceeds 25 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

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

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

                                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 cloneScan has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function cloneScan($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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language