Showing 286 of 512 total issues
Method index
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function index(Request $request, Validator $validator)
{
if ($request->isMethod('post')) {
$message = $request->input('message');
$name = $request->input('name');
Method talk
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function talk(string $login): View
{
if (is_numeric($login)) {
$user = new User();
$user->id = $login;
Method changeMail
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function changeMail(Request $request, Validator $validator): RedirectResponse
{
if (! $user = getUser()) {
abort(403, __('main.not_authorized'));
}
Method comments
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function comments(int $id, Request $request, Validator $validator, Flood $flood)
{
/** @var Offer $offer */
$offer = Offer::query()->find($id);
Method deleteFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deleteFile(Request $request, Validator $validator): JsonResponse
{
$types = [
Article::$morphName,
Item::$morphName,
Method install
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function install(Request $request): RedirectResponse
{
$moduleName = $request->input('module');
$enable = int($request->input('enable'));
$update = int($request->input('update'));
Method editTopic
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editTopic(int $id, Request $request, Validator $validator)
{
/** @var Topic $topic */
$topic = Topic::query()->find($id);
Method comments
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function comments(int $id, Request $request, Validator $validator, Flood $flood): View|RedirectResponse
{
/** @var Article $article */
$article = Article::query()->find($id);
Method edit
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function edit(int $id, Request $request, Validator $validator)
{
if (! $user = getUser()) {
abort(403, __('main.not_authorized'));
}
Method index
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function index(Request $request, Validator $validator)
{
if ($request->isMethod('post')) {
$msg = $request->input('msg');
$type = int($request->input('type'));
Method edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function edit(int $id, Request $request, Validator $validator)
{
if (! isAdmin(User::BOSS)) {
abort(403, __('errors.forbidden'));
}
Method create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create(string $login, Request $request, Validator $validator, Flood $flood): RedirectResponse
{
if (! getUser()) {
abort(403, __('main.not_authorized'));
}
Method editComment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editComment(int $id, int $cid, Request $request, Validator $validator): View|RedirectResponse
{
$down = Down::query()->find($id);
if (! $down) {
Method editComment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editComment(int $id, int $cid, Request $request, Validator $validator)
{
$page = int($request->input('page', 1));
if (! $user = getUser()) {
Method editComment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editComment(int $id, int $cid, Request $request, Validator $validator)
{
$page = int($request->input('page', 1));
/** @var Offer $offer */
Method editComment
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editComment(int $id, int $cid, Request $request, Validator $validator): View|RedirectResponse
{
$page = int($request->input('page', 1));
/** @var Article $article */
Method login
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function login(Request $request, Validator $validator, Flood $flood)
{
if (getUser()) {
setFlash('danger', __('main.already_authorized'));
Method create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create(Request $request, Validator $validator)
{
if ($request->isMethod('post')) {
$question = $request->input('question');
$description = $request->input('description');
Function actionTopic
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function actionTopic(int $id, Request $request): RedirectResponse
{
$page = int($request->input('page', 1));
/** @var Topic $topic */
- 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 create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function create(Request $request, Validator $validator)
{
if ($request->isMethod('post')) {
$question = $request->input('question');
$description = $request->input('description');
- 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"