Showing 151 of 1,190 total issues
File index.js
has 906 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xHttp from "../xHttp.js";
import {
genericCallback,
reloadCallback,
injectHtml,
Invoice
has 92 functions (exceeds 20 allowed). Consider refactoring. Open
class Invoice extends AbstractEntity
{
/** Table name in database. */
public const TABLE_NAME = 'fakturas';
Function index
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
public function index(Request $request): Response
{
app(DbService::class)->addLoadedTable('bind', 'kat', 'krav', 'maerke', 'sider');
$response = $this->cachedResponse();
if ($response->isNotModified($request)) {
- 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 Invoice.php
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Models;
use App\DTO\InvoiceItem;
Function createFromCart
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
public function createFromCart(array $cart): Invoice
{
$db = app(DbService::class);
$orm = app(OrmService::class);
$amount = 0;
- 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 ExplorerController.php
has 591 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers\Admin;
use App\Exceptions\Exception;
Method getCountries
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getCountries(): array
{
return [
'DK' => _('Denmark'),
'FI' => _('Finland'),
File explorer.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xHttp from "../xHttp.js";
import File from "./File.js";
import openPopup from "./openPopup.js";
import {injectHtml, setCookie, getCookie, htmlEncode, removeTagById} from "./javascript.js";
import * as Sentry from '@sentry/browser';
Page
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Page extends AbstractRenderable implements InterfaceRichText
{
use HasIcon;
/** Table name in database. */
Method load
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function load(Application $app): void
{
$app->middleware([Utf8Url::class, Auth::class]);
if ($app->environment('develop')) {
$app->middleware(Placekitten::class);
Function buildSearchQuery
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private function buildSearchQuery(string $qpath, string $qalt, string $qtype): string
{
$db = app(DbService::class);
$qpath = $db->escapeWildcards($qpath);
$qalt = $db->escapeWildcards($qalt);
- 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 InvoiceService.php
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use App\Countries;
Function invoiceBasicUpdate
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function invoiceBasicUpdate(Invoice $invoice, User $user, InvoiceAction $action, array $updates): void
{
$status = $invoice->getStatus();
if (InvoiceStatus::New === $invoice->getStatus()) {
- 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 Payment.php
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use App\Countries;
Method index
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(Request $request): Response
{
app(DbService::class)->addLoadedTable('bind', 'kat', 'krav', 'maerke', 'sider');
$response = $this->cachedResponse();
if ($response->isNotModified($request)) {
File MaintenanceController.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers\Admin;
use AJenbo\Imap;
File Page.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Models;
use App\Exceptions\Exception;
Method invoiceBasicUpdate
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invoiceBasicUpdate(Invoice $invoice, User $user, InvoiceAction $action, array $updates): void
{
$status = $invoice->getStatus();
if (InvoiceStatus::New === $invoice->getStatus()) {
Function getInvalid
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getInvalid(): array
{
$invalid = [];
if (!$this->hasValidEmail()) {
- 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
Method address
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function address(Request $request, string $phoneNumber): JsonResponse
{
$db = app(DbService::class);
$db->addLoadedTable('fakturas', 'email', 'post');