Showing 1,558 of 1,561 total issues
Method handle
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handle($status)
{
$media = $status->media;
$ai = new AccountInterstitial;
Method validateUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validateUrl($url)
{
if (is_array($url)) {
$url = $url[0];
}
Method getAccountSettings
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAccountSettings(Request $request)
{
$this->validate($request, [
'id' => 'required|integer'
]);
Method storeShare
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function storeShare(Request $request)
{
$this->authCheck();
$this->validate($request, [
Method userModerate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function userModerate(Request $request)
{
$this->validate($request, [
'profile_id' => 'required|exists:profiles,id',
'action' => 'required|in:cw,no_autolink,unlisted'
Method accountMuteById
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountMuteById(Request $request, $id)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
Method accountBlocks
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountBlocks(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method composeText
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function composeText(Request $request)
{
$this->validate($request, [
'type' => [
'required',
Method accountToId
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountToId(Request $request)
{
abort_unless((
config_cache('pixelfed.open_registration') &&
config('remote-auth.mastodon.enabled')
Method sessionCheck
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sessionCheck(Request $request)
{
abort_unless((
config_cache('pixelfed.open_registration') &&
config('remote-auth.mastodon.enabled')
Method updateMediaSettings
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateMediaSettings(Request $request)
{
$this->validate($request, [
'default' => 'required|int|min:1|max:16',
'sync' => 'nullable',
Method transform
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transform(Status $status)
{
return [
'@context' => [
'https://w3id.org/security/v1',
Function handle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$status = $this->status;
$actor = $status->profile;
$reply = Status::find($status->in_reply_to_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 fixUncategorizedSpam
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function fixUncategorizedSpam(Request $request)
{
if (Cache::get('admin-dash:reports:spam-sync-active')) {
return redirect('/i/admin/reports/autospam');
}
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): void
{
if ($this->batch()->cancelled()) {
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"
Further reading
Function fetchAvatar
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function fetchAvatar($avatar, $local = false, $skipRecentCheck = false)
{
$queue = random_int(1, 15) > 5 ? 'mmo' : 'low';
$url = $avatar->remote_url;
$driver = $local ? 'local' : config('filesystems.cloud');
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function create(Request $request)
{
$this->validate($request, [
'to_id' => 'required',
'message' => 'required|string|min:1|max:500',
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): void
{
$this->info(' ____ _ ______ __ ');
$this->info(' / __ \(_) _____ / / __/__ ____/ / ');
$this->info(' / /_/ / / |/_/ _ \/ / /_/ _ \/ __ / ');
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$profile = $this->profile;
if ((bool) config_cache('pixelfed.cloud_storage') == false && (bool) config_cache('federation.avatars.store_local') == false) {
Method handle
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
if ((bool) config_cache('pixelfed.cloud_storage') == false) {
// Only run if cloud storage is enabled
return;