Showing 20 of 30 total issues
Function isQualified
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function isQualified(Group $group)
{
$action = new GetCurrentAffiliationAction;
- 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 update
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function update(Request $request, $id)
{
$seatgroup = SeatGroup::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
Method update
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update(Request $request, $id)
{
$seatgroup = SeatGroup::find($id);
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(array $data)
{
$seatgroup = SeatGroup::find($data['seatgroup_id']);
$affiliations = collect();
Method handle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(GroupApplication $event)
{
$should_send = false;
if (class_exists(SeatNotificationsServiceProvider::class))
Method up
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('seatgroups', function ($table) {
$table->increments('id')->index();
$table->string('name');
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(Group $group)
{
$this->group = $group;
$main_character = $this->get_main_character_action->execute($this->group);
$this->has_missing_refresh_token = false;
Function mergeConfigs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function mergeConfigs(array $original, array $merging)
{
$array = array_merge($original, $merging);
foreach ($original as $key => $value) {
- 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 execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(Group $group) : Collection
{
$this->group = $group;
Method handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(GroupSynced $event)
{
if (empty($event->sync['attached']) && empty($event->sync['detached']))
$this->delete();
Function execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function execute(array $data)
{
$seatgroup = SeatGroup::find($data['seatgroup_id']);
if(isset($data['groups'])){
- 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute(Group $group)
{
$this->group = $group;
$main_character = $this->get_main_character_action->execute($this->group);
$this->has_missing_refresh_token = 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 isManager
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isManager(Group $group)
{
if (in_array($group->id, $this->manager->pluck('id')->toArray()))
return true;
- 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 redirect()->back()->with('warning', 'ups something went wrong');
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return redirect()->back()->with('success', 'Updated');
Avoid too many return
statements within this method. Open
return false;
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute(Group $group)
{
$this->group = $group;
//Catch superuser permissions
- 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(GroupSynced $event)
{
$should_send = false;
if (! empty($event->sync['attached']))
- 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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function destroy($id)
{
$seatgroup = SeatGroup::find($id);
if ($seatgroup->type == 'open') {
- 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"