Showing 1,326 of 1,561 total issues
Method conversations
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function conversations(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method outbox
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function outbox()
{
$res = json_encode([
"@context" => [
"https://www.w3.org/ns/activitystreams",
Method stepTwo
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function stepTwo($request)
{
if($request->filled('reason')) {
$request->session()->put('cur-reg.form-reason', $request->input('reason'));
}
ApiV1Dot1Controller
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ApiV1Dot1Controller extends Controller
{
protected $fractal;
public function __construct()
Method profileUpdateOrCreate
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function profileUpdateOrCreate($url)
{
$res = self::fetchProfileFromUrl($url);
if (! $res || isset($res['id']) == false) {
return;
Method unlinkRemoveMedia
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function unlinkRemoveMedia($status)
{
if($status->in_reply_to_id) {
$parent = Status::find($status->in_reply_to_id);
Method buildProfile
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildProfile(Request $request, $user)
{
$username = $user->username;
$loggedIn = Auth::check();
$isPrivate = false;
File CollectionController.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
Method accountEmailsFromPixelfed
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function accountEmailsFromPixelfed(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method handle
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle()
{
$actor = $this->actor;
$target = $this->target;
Method handle
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(): void
{
if((bool) config_cache('pixelfed.cloud_storage') === false) {
return;
}
Method verifySignature
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function verifySignature($headers, $payload)
{
$body = $this->payload;
$bodyDecoded = $payload;
$signature = is_array($headers['signature']) ? $headers['signature'][0] : $headers['signature'];
Method getAutospamConfigApi
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAutospamConfigApi(Request $request)
{
$open = Cache::remember('admin-dash:reports:spam-count', 3600, function() {
return AccountInterstitial::whereType('post.autospam')->whereNull('appeal_handled_at')->count();
});
Method settingsApiUpdateUsersType
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function settingsApiUpdateUsersType($request)
{
$this->validate($request, [
'require_email_verification' => 'required',
'enforce_account_limit' => 'required',
Method store
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function store(Request $request)
{
if (Auth::check() === false) {
abort(403);
}
Method comment
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function comment(Request $request)
{
abort_if(! (bool) config_cache('instance.stories.enabled') || ! $request->user(), 404);
$this->validate($request, [
'sid' => 'required',
Function getMaxMastodon
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getMaxMastodon($id = false, $start = 0, $limit = 10)
{
$ids = self::getRankedMaxId($id, $start, $limit);
if (empty($ids)) {
- 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 updateUrls
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function updateUrls()
{
$this->info('Updating urls...');
$oldDomain = trim($this->argument('oldDomain'));
$newDomain = trim($this->argument('newDomain'));
- 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
File AdminUserController.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers\Admin;
use Cache, DB;
File ImportPostController.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;