Showing 17 of 30 total issues
Function handle
has a Cognitive Complexity of 20 (exceeds 5 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;
- Read upRead up
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 handle
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$drivers_parameter = $this->option('driver');
$drivers = collect(array_keys(config('seat-connector.drivers')));
- Read upRead up
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 notifyDrivers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function notifyDrivers(SeatUser $user)
{
// extract registered drivers from the configuration stack
$drivers = collect(array_keys(config('seat-connector.drivers')));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method notifyDrivers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function notifyDrivers(SeatUser $user)
{
// extract registered drivers from the configuration stack
$drivers = collect(array_keys(config('seat-connector.drivers')));
Function validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function validate(array $schema, array $structure)
{
foreach ($schema as $element => $component) {
if (is_int($element))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method up
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::table('seat_connector_users')
->select('group_id')
->orderBy('group_id')
Method index
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(AccessDataTable $datatable)
{
$filter_type = '';
// retrieve all registered SeAT Connector drivers
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;
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')));
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
- Read upRead up
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) {
- Read upRead up
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 'alliances';
Avoid too many return
statements within this method. Open
return $class_name;
Avoid too many return
statements within this method. Open
return 'squads';
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);
- Read upRead up
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) {
- Read upRead up
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 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);
- Read upRead up
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"