Showing 1,326 of 1,561 total issues
Method toArray
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray($request)
{
$status = $this;
$taggedPeople = MediaTagService::get($status->id);
$poll = $status->type === 'poll' ? PollService::get($status->id) : null;
Method accountFavourites
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accountFavourites(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method apiUsernameCheck
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apiUsernameCheck(Request $request)
{
$this->validate($request, [
'token' => 'required',
'username' => 'required'
Method statusFavouriteById
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function statusFavouriteById(Request $request, $id)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
Method handle
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$this->info('Welcome to the avatar sync manager');
$this->line(' ');
$this->line(' ');
Method handle
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$duplicates = DB::table('profiles')
->whereNull('domain')
->select('username', DB::raw('COUNT(*) as "count"'))
Method get
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get()
{
$res = Cache::remember('api:nodeinfo', 900, function () {
$activeHalfYear = self::activeUsersHalfYear();
$activeMonth = self::activeUsersMonthly();
Method fanoutDelete
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fanoutDelete($status)
{
$profile = $status->profile;
if (! $profile) {
Method get
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get($url, $validateUrl = true)
{
if($validateUrl === true) {
if(!Helpers::validateUrl($url)) {
return 0;
Method getRssFeed
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRssFeed(Request $request, $username)
{
$user = User::whereUsername($username)->first();
if(!$user) {
Method storeReport
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function storeReport(Request $request)
{
abort_if(! (bool) config_cache('instance.stories.enabled') || ! $request->user(), 404);
$this->validate($request, [
Method modReportHandle
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function modReportHandle(Request $request)
{
abort_if(!$request->user() || !$request->user()->token(), 404);
abort_unless($request->user()->is_admin == 1, 404);
Method remoteDeliver
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function remoteDeliver($dm)
{
$profile = $dm->author;
$url = $dm->recipient->sharedInbox ?? $dm->recipient->inbox_url;
Function decode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function decode (string $blurhash, int $width, int $height, float $punch = 1.0, bool $linear = false): array {
if (empty($blurhash) || strlen($blurhash) < 6) {
throw new InvalidArgumentException("Blurhash string must be at least 6 characters");
}
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$username = $this->username;
$headers = $this->headers;
- 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 updateImmediateAttributes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function updateImmediateAttributes($status, $activity)
{
if (isset($activity['content'])) {
$status->caption = strip_tags($activity['content']);
$status->rendered = Purify::clean($activity['content']);
- 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 importNoteAttachment
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function importNoteAttachment($data, Status $status)
{
if (self::verifyAttachments($data) == false) {
// \Log::info('importNoteAttachment::failedVerification.', [$data['id']]);
$status->viewType();
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): void
{
if(!config('exp.cached_home_timeline')) {
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 profileUpdateOrCreate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function profileUpdateOrCreate($url)
{
$res = self::fetchProfileFromUrl($url);
if (! $res || isset($res['id']) == false) {
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 get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function get($domain)
{
$version = config('pixelfed.version');
$appUrl = config('app.url');
$headers = [
- 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"