Showing 1,326 of 1,561 total issues
Method handle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$localDisk = Storage::disk('local');
$cloudDisk = Storage::disk('backup');
$backupDestination = new BackupDestination($localDisk, '', 'local');
Method handle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$status = $this->status;
$parent = Status::find($this->status->reblog_of_id);
if (! $parent) {
Method mapInvite
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function mapInvite($id, $data = [])
{
$roles = self::get($id);
$map = [
Method get
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function get($account, $version = 1)
{
$mh = hash('sha256', date('Y').'-.-'.date('m'));
if($account instanceOf User) {
Method mapActions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function mapActions($id, $data = [])
{
$res = [];
$map = [
'account-force-private' => 'private',
Method storage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function storage()
{
return Cache::remember('admin:dashboard:storage:stats', 120000, function() {
$res = [];
Method blocks
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function blocks(int $profile_id)
{
$key = self::USER_BLOCKS_KEY . $profile_id;
$warm = Cache::has($key . ':cached-v0');
if($warm) {
Method mutes
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function mutes(int $profile_id)
{
$key = self::USER_MUTES_KEY . $profile_id;
$warm = Cache::has($key . ':cached-v0');
if($warm) {
Method userDeleteProcess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function userDeleteProcess(Request $request, $id)
{
$user = User::findOrFail($id);
$profile = $user->profile;
Method accountSearch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function accountSearch(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method sessionGetMastodonData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function sessionGetMastodonData(Request $request)
{
abort_unless((
config_cache('pixelfed.open_registration') &&
config('remote-auth.mastodon.enabled')
Method userProfile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function userProfile($user)
{
if (empty($user->profile)) {
if($user->created_at->lt(now()->subDays(1)) && empty($user->status)) {
$p = Profile::withTrashed()->whereUserId($user->id)->first();
Method handle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(): void
{
$hashtag = $this->hashtag;
$sid = $hashtag->status_id;
$status = StatusService::get($sid, false);
Method verifyAttachments
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function verifyAttachments($data)
{
if (! isset($data['object']) || empty($data['object'])) {
$data = ['object' => $data];
}
Method cloudMove
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function cloudMove($media)
{
if (! Storage::exists($media->media_path)) {
return 'invalid file';
}
Method refetchAllPosts
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function refetchAllPosts()
{
$profile = $this->profile;
$res = ActivityPubFetchService::get($profile->remote_url, false);
if(!$res) {
Method toArray
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArray(Request $request): array
{
$instance = parse_url($this->uri, PHP_URL_HOST);
$statuses = [];
if($this->status_ids && count($this->status_ids)) {
Method fixUncategorizedSpam
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fixUncategorizedSpam(Request $request)
{
if (Cache::get('admin-dash:reports:spam-sync-active')) {
return redirect('/i/admin/reports/autospam');
}
Method importBackup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function importBackup(Request $request)
{
$this->validate($request, [
'banned' => 'sometimes|array',
'auto_cw' => 'sometimes|array',
Method twoFactorVerify
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function twoFactorVerify(Request $request)
{
$this->validate($request, [
'code' => 'required|string|max:32'
]);