Showing 1,327 of 1,562 total issues
Method handlePollVote
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handlePollVote()
{
$activity = $this->payload['object'];
$actor = $this->actorFirstOrCreate($this->payload['actor']);
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($user)
{
$avatar = $user ? $user->avatarUrl() : url('/storage/avatars/default.jpg');
$avatarPath = parse_url($avatar, PHP_URL_PATH);
$extension = pathinfo($avatarPath, PATHINFO_EXTENSION);
Method settingsApiUpdateHomeType
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function settingsApiUpdateHomeType($request)
{
$this->validate($request, [
'registration_status' => 'required|in:open,filtered,closed',
'cloud_storage' => 'required',
Method accountFollowRequestAccept
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function accountFollowRequestAccept(Request $request, $id)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('follow'), 403);
Method accountMutes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function accountMutes(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method instagramStepOneStore
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function instagramStepOneStore(Request $request, $uuid)
{
if((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
abort(404, 'Feature not enabled');
}
Method store
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function store(Request $request)
{
$rules = [
'username' => 'required|min:2|max:15|exists:users'
];
Method transform
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function transform(Status $status)
{
return [
'@context' => [
'https://www.w3.org/ns/activitystreams',
Method handleNoteCreate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handleNoteCreate()
{
$activity = $this->payload['object'];
$actor = $this->actorFirstOrCreate($this->payload['actor']);
if(!$actor || $actor->domain == null) {
Method handle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(): void
{
if ($this->batch()->cancelled()) {
return;
}
Method postsGraph
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected static function postsGraph()
{
$ttl = now()->addHours(12);
return Cache::remember('admin:dashboard:home:data-postsGraph:v0.1:24hr', $ttl, function() {
$gb = config('database.default') == 'pgsql' ? ['statuses.id', 'created_at'] : DB::raw('Date(created_at)');
Method mediaUpdate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function mediaUpdate(Request $request)
{
$this->validate($request, [
'id' => 'required',
'file' => function () {
Method buildPath
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function buildPath($id)
{
$padded = str_pad($id, 19, 0, STR_PAD_LEFT);
$parts = str_split($padded, 3);
foreach ($parts as $k => $part) {
Method conciergeFormStore
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function conciergeFormStore(Request $request)
{
abort_if($request->user(), 404);
$request->session()->increment('cur-reg-con-attempt');
abort_unless(
Method handle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$this->info('Running avatar migration...');
$count = Avatar::whereChangeCount(0)->count();
Method uploadAvatarsToCloud
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function uploadAvatarsToCloud()
{
if(!(bool) config_cache('pixelfed.cloud_storage') || !config('instance.avatar.local_to_cloud')) {
$this->error('Enable cloud storage and avatar cloud storage to perform this action');
return;
Method handle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$tag = $this->argument('tag');
$hashtag = Hashtag::whereName($tag)->orWhere('slug', $tag)->first();
if(!$hashtag) {
Method getAudience
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAudience($scope = false)
{
if($this->remote_url) {
return [];
}
Method importActivity
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function importActivity($activity)
{
$profile = $this->profile;
$supported = $this->supported;
$attachments = $activity['object']['attachment'];
Method fanoutExpiry
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function fanoutExpiry($profile, $activity)
{
$audience = FollowerService::softwareAudience($profile->id, 'pixelfed');
if(empty($audience)) {