Showing 1,326 of 1,561 total issues
ApiV1Controller
has 64 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ApiV1Controller extends Controller
{
protected $fractal;
const PF_API_ENTITY_KEY = '_pe';
Method timelineHome
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function timelineHome(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
Method accountUpdateCredentials
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function accountUpdateCredentials(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
Function FakeBlobBuilder
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FakeBlobBuilder () {
function isDataView (obj) {
return obj && DataView.prototype.isPrototypeOf(obj)
}
function bufferClone (buf) {
Method reportsHandleProfileAction
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function reportsHandleProfileAction($report, $action)
{
switch ($action) {
case 'ignore':
Report::whereObjectId($report->object_id)
Function checkPermissions
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function checkPermissions($request, $abortOnFail = true)
{
$user = $request->user();
if($abortOnFail) {
- 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 activity-log.blade.php
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<template v-if="loaded">
@if($email_verified_at === null)
<div class="alert alert-danger mb-3">
<p class="mb-0 font-weight-bold">Applicant has not verified their email address yet, action can not be taken at this time.</p>
</div>
Function statusCreate
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
Open
public function statusCreate(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
- 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 PortfolioController.php
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
Method statusCreate
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function statusCreate(Request $request)
{
abort_if(! $request->user() || ! $request->user()->token(), 403);
abort_unless($request->user()->tokenCan('write'), 403);
Method getData
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getData(Request $request)
{
abort_if(now()->gt('2021-03-01 00:00:00'), 404);
abort_if(config('database.default') != 'mysql', 404);
File StoryComposeController.php
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers;
use App\DirectMessage;
File StoryApiV1Controller.php
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers\Stories;
use App\DirectMessage;
File home.blade.php
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
@extends('admin.partial.template-full')
@section('section')
</div>
<div class="header bg-primary pb-2 mt-n4">
Method reportsApiRemoteHandle
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function reportsApiRemoteHandle(Request $request)
{
$this->validate($request, [
'id' => 'required|exists:remote_reports,id',
'action' => 'required|in:mark-read,cw-posts,unlist-posts,delete-posts,private-posts,mark-all-read-by-domain,mark-all-read-by-username,cw-all-posts,private-all-posts,unlist-all-posts'
Method settingsHomeStore
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function settingsHomeStore(Request $request)
{
$this->validate($request, [
'name' => 'nullable|string',
'short_description' => 'nullable',
Method statusFirstOrFetch
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function statusFirstOrFetch($url, $replyTo = false)
{
$url = self::validateUrl($url);
if ($url == false) {
return;
Method userAdminAction
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function userAdminAction(Request $request)
{
abort_if(!$request->user() || !$request->user()->token(), 404);
abort_unless($request->user()->is_admin == 1, 404);
File Installer.php
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
Method modAction
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function modAction(Request $request)
{
abort_unless(Auth::user()->is_admin, 400);
$this->validate($request, [
'action' => [