Showing 1,326 of 1,561 total issues
Method handleFlagActivity
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleFlagActivity()
{
if(!isset(
$this->payload['id'],
$this->payload['type'],
Method report
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function report(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
Method accountStatuses
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountStatuses(Request $request, $id)
{
$this->validate($request, [
'only_media' => 'nullable',
'pinned' => 'nullable',
Function verifySignature
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function verifySignature($headers, $profile, $payload)
{
$body = $this->payload;
$bodyDecoded = $payload;
$signature = is_array($headers['signature']) ? $headers['signature'][0] : $headers['signature'];
- 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 verifySignature
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function verifySignature($headers, $payload)
{
$body = $this->payload;
$bodyDecoded = $payload;
$signature = is_array($headers['signature']) ? $headers['signature'][0] : $headers['signature'];
- 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 storeSettings
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function storeSettings(Request $request)
{
abort_if(!$request->user(), 403);
$this->validate($request, [
- 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 settingsApiUpdateStorageType
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function settingsApiUpdateStorageType($request)
{
$this->validate($request, [
'primary_disk' => 'required|in:local,cloud',
'update_disk' => 'sometimes',
- 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 privacyStore
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function privacyStore(Request $request)
{
$settings = $request->user()->settings;
$profile = $request->user()->profile;
$fields = [
- 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 handle
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$activity = $this->activity;
$activityId = $activity['id'];
$activityActor = $activity['actor'];
File SettingsController.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use App\AccountLog;
Installer
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Installer extends Command
{
/**
* The name and signature of the console command.
*
Method get
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get()
{
return Cache::remember(self::CACHE_KEY, 900, function () {
$hls = [
'enabled' => config('media.hls.enabled'),
Method handleDeleteActivity
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleDeleteActivity()
{
if(!isset(
$this->payload['actor'],
$this->payload['object']
Method get
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get($json = true)
{
$activeMonth = Nodeinfo::activeUsersMonthly();
$totalUsers = Cache::remember('api:nodeinfo:users', 43200, function () {
Method apiRegister
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apiRegister(Request $request)
{
$this->validate($request, [
'token' => 'required',
'username' => [
Method mediaUpload
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mediaUpload(Request $request)
{
abort_if(! $request->user(), 403);
$this->validate($request, [
Method accountFollowersById
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountFollowersById(Request $request, $id)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method accountFollowingById
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountFollowingById(Request $request, $id)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Function encode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function encode(array $image, int $components_x = 4, int $components_y = 4, bool $linear = false): string {
if (($components_x < 1 || $components_x > 9) || ($components_y < 1 || $components_y > 9)) {
throw new InvalidArgumentException("x and y component counts must be between 1 and 9 inclusive.");
}
$height = count($image);
- 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 normalizeAudience
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function normalizeAudience($data, $localOnly = true)
{
if (! isset($data['to'])) {
return;
}
- 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"