Showing 14 of 135 total issues
Method callback
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function callback(Request $request)
{
// get back pending OAuth credentials validation from session
$credentials = $request->session()->get('herpaderp.seatnotifications.discord.credentials');
Method callback
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function callback(Request $request)
{
// get back pending OAuth credentials validation from session
$credentials = $request->session()->get('herpaderp.seatnotifications.slack.credentials');
Method callback
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function callback()
{
$state = request()->session()->get('herpaderp.seatnotifications.slack.user.state');
request()->session()->forget('herpaderp.seatnotifications.slack.user.state');
Method getCategories
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function getCategories(int $category_id = null): Collection
{
$params = [
'api_key' => setting('herpaderp.seatnotifications.discourse.credentials.api_key', true),
];
Function mergeConfigs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
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
Function execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute(array $data)
{
if (array_key_exists('characters_filter', $data) || array_key_exists('corporations_filter', $data)) {
- 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 callback
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function callback()
{
$state = request()->session()->get('herpaderp.seatnotifications.discord.user.state');
request()->session()->forget('herpaderp.seatnotifications.discord.user.state');
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute(array $data)
{
try {
$subscription = NotificationRecipient::where('driver_id', $data['driver_id'])
Method handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
// Check if victim and attacker details are present yet.
if(empty($this->killmail_detail->victims) || empty($this->killmail_detail->attackers)){
Avoid too many return
statements within this method. Open
Open
return $this->subscribe_action->execute($data);
Avoid too many return
statements within this method. Open
Open
return redirect()->route('seatnotifications.configuration')
->with('success', 'The bot credentials has been set.');
Avoid too many return
statements within this method. Open
Open
return redirect()->route('seatnotifications.configuration')
->with('error', 'An error occurred while trying to create websocket connection with Discord. ' .
$e->getMessage());
Avoid too many return
statements within this method. Open
Open
return redirect()->route('seatnotifications.configuration')
->with('error', 'An error occurred while trying to create websocket connection with Discord. ' .
$identified);
Avoid too many return
statements within this method. Open
Open
return redirect()->route('seatnotifications.configuration')
->with('success', 'The bot credentials has been set.');