Showing 286 of 512 total issues
File helpers.php
has 1179 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use App\Classes\BBCode;
use App\Classes\Calendar;
use App\Classes\CloudFlare;
File web.php
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
use App\Http\Controllers\Admin\AdminAdvertController;
File UserController.php
has 615 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers\User;
Function delete
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
public function delete(Request $request, Validator $validator): View|RedirectResponse
{
$user = getUserByLogin($request->input('user'));
if (! $user) {
- 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 main.js
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(function () {
let html = $('html');
let currentLang = html.attr('lang');
translate = window['translate_' + currentLang];
Function edit
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function edit(int $id, Request $request, Validator $validator)
{
if (! $user = getUser()) {
abort(403, __('main.not_authorized'));
}
- 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 TopicController.php
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Forum;
File ArticleController.php
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers;
File DownController.php
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Load;
File User.php
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Models;
Method run
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$data = [
'id' => 1,
'name' => 'Смайлы',
Method run
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$data = [
['name' => 'app_installed', 'value' => 0],
['name' => 'addbansend', 'value' => 1],
Function create
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function create(Request $request, Validator $validator, Flood $flood): View|RedirectResponse
{
$cid = int($request->input('category'));
if (! isAdmin() && ! setting('downupload')) {
- 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 ForumController.php
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Admin;
Method run
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$data = [
[
'type' => 'register',
User
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends BaseModel implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
Method register
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(Request $request, Validator $validator)
{
if (getUser()) {
abort(403, __('users.already_registered'));
}
Method edit
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit(Request $request, Validator $validator): View|RedirectResponse
{
$user = getUserByLogin($request->input('user'));
if (! $user) {
Function register
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function register(Request $request, Validator $validator)
{
if (getUser()) {
abort(403, __('users.already_registered'));
}
- 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 AjaxController.php
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace App\Http\Controllers;