mageni/mageni

View on GitHub
src/frontend/app/Http/Livewire/Classes/Socket.php

Summary

Maintainability
F
4 days
Test Coverage

File Socket.php has 865 lines of code (exceeds 250 allowed). Consider refactoring.
Invalid

<?php

namespace App\Http\Livewire\Classes;

use Illuminate\Support\Facades\Log;
Severity: Major
Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 2 days 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 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 modifyScan has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Invalid

                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

              Method createAsset has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Invalid

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

                Method modifySchedule has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Invalid

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

                  Method modifySSH has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Invalid

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

                    Method createSSH has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Invalid

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

                      Method createAlert has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Invalid

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

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

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

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

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

                            Method modifySMB has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Invalid

                                public function modifySMB($data, $id = null)
                                {
                                    /**
                                     * 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 modifyAlert has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function modifyAlert($data)
                                    {
                                        /**
                                         * 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 createScan has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Invalid

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

                                      Method createSchedule has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Invalid

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

                                        Method deleteScan has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Invalid

                                            public function deleteScan($data, $id)
                                            {
                                                /**
                                                 * 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 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

                                                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

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

                                                    public function modifySchedule($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 modifySMB has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                Open

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Avoid too many return statements within this method.
                                                Open

                                                            return $this->isbool;
                                                Severity: Major
                                                Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return $this->isbool;
                                                  Severity: Major
                                                  Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                    return $this->failure;
                                                    Severity: Major
                                                    Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return $this->isbool;
                                                      Severity: Major
                                                      Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return $this->isbool;
                                                        Severity: Major
                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return $this->isbool;
                                                          Severity: Major
                                                          Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                            return $this->error400;
                                                            Severity: Major
                                                            Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return $this->isbool;
                                                              Severity: Major
                                                              Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                return $this->failure;
                                                                Severity: Major
                                                                Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                              return $this->success;
                                                                  Severity: Major
                                                                  Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                return $this->isbool;
                                                                    Severity: Major
                                                                    Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                  return $this->isbool;
                                                                      Severity: Major
                                                                      Found in src/frontend/app/Http/Livewire/Classes/Socket.php - About 30 mins to fix

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function resumeScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 1 other location - About 2 days to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 965..1038

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 533.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function startScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 1 other location - About 2 days to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1110..1184

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 533.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function createAlert($data)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 3 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 326..394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 611..679
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 681..749

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 397.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function createPorts($data)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 3 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 326..394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 468..537
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 681..749

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 397.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function createSMB($data)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 3 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 326..394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 468..537
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 611..679

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 397.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 4 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function createSchedule($data)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 3 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 468..537
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 611..679
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 681..749

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 397.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function deleteSchedule($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1040..1108
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1186..1254
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1256..1324
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1326..1394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1396..1464

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function unlockScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1040..1108
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1186..1254
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1256..1324
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1396..1464
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1466..1534

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function cloneScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1040..1108
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1186..1254
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1256..1324
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1326..1394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1466..1534

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function lockScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1040..1108
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1186..1254
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1326..1394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1396..1464
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1466..1534

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function deleteScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1040..1108
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1256..1324
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1326..1394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1396..1464
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1466..1534

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 6 locations. Consider refactoring.
                                                                        Invalid

                                                                            public function stopScan($data, $id)
                                                                            {
                                                                                /**
                                                                                 * Set Permissions
                                                                                 */
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 5 other locations - About 1 day to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1186..1254
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1256..1324
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1326..1394
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1396..1464
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 1466..1534

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 391.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Invalid

                                                                                if(!is_bool($this->json_decode_xml))
                                                                                {
                                                                                    if ($this->json_decode_xml['@attributes']['status'] == 201) 
                                                                                    {
                                                                                        Log::info('[SUCCESS] Created Asset ' . $this->json_decode_xml['@attributes']['id']);
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 1 other location - About 2 hrs to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 875..890

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 126.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        Similar blocks of code found in 2 locations. Consider refactoring.
                                                                        Invalid

                                                                                if(!is_bool($this->json_decode_xml))
                                                                                {
                                                                                    if ($this->json_decode_xml['@attributes']['status'] == 201) {
                                                                                        Log::info('[SUCCESS] SSH Credential Created ' . $this->json_decode_xml['@attributes']['id']);
                                                                                        return $this->json_decode_xml['@attributes']['id'];
                                                                        Severity: Major
                                                                        Found in src/frontend/app/Http/Livewire/Classes/Socket.php and 1 other location - About 2 hrs to fix
                                                                        src/frontend/app/Http/Livewire/Classes/Socket.php on lines 232..248

                                                                        Duplicated Code

                                                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                        Tuning

                                                                        This issue has a mass of 126.

                                                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                        Refactorings

                                                                        Further Reading

                                                                        There are no issues that match your filters.

                                                                        Category
                                                                        Status