warlof/seat-connector

View on GitHub

Showing 30 of 30 total issues

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

    public function handle()
    {
        $drivers_parameter = $this->option('driver');
        $drivers = collect(array_keys(config('seat-connector.drivers')));
        $terminator = $this->option('terminator') ?: false;
Severity: Minor
Found in src/Commands/DriverApplyPolicies.php - About 1 hr to fix

    Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handle()
        {
            $drivers_parameter = $this->option('driver');
            $drivers = collect(array_keys(config('seat-connector.drivers')));
    
    
    Severity: Minor
    Found in src/Commands/DriverUpdateSets.php - About 1 hr to fix

      Function index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function index(AccessDataTable $datatable)
          {
              $filter_type = '';
      
              // retrieve all registered SeAT Connector drivers
      Severity: Minor
      Found in src/Http/Controllers/AccessController.php - About 45 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 remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function remove(AccessRuleValidation $request)
          {
              $entity_type = $this->classAlias($request->input('entity_type'));
      
              switch ($entity_type) {
      Severity: Minor
      Found in src/Http/Controllers/AccessController.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 'squads';
      Severity: Major
      Found in src/Http/Controllers/AccessController.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return $class_name;
        Severity: Major
        Found in src/Http/Controllers/AccessController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return 'alliances';
          Severity: Major
          Found in src/Http/Controllers/AccessController.php - About 30 mins to fix

            Function handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function handle()
                {
                    $config_key = sprintf('seat-connector.drivers.%s.client', $this->driver);
                    $client = config($config_key);
            
            
            Severity: Minor
            Found in src/Jobs/DriverApplyPolicies.php - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function destroy(int $id)
                {
                    // attempt to retrieve requested identity
                    $identity = User::find($id);
            
            
            Severity: Minor
            Found in src/Http/Controllers/UsersController.php - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function create(AccessRuleValidation $request)
                {
                    $entity_type = $request->input('entity_type');
            
                    switch ($entity_type) {
            Severity: Minor
            Found in src/Http/Controllers/AccessController.php - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language