Showing 151 of 1,190 total issues
Contact
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Contact extends AbstractEntity
{
/** Table name in database. */
public const TABLE_NAME = 'email';
Method createFromCart
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createFromCart(array $cart): Invoice
{
$db = app(DbService::class);
$orm = app(OrmService::class);
$amount = 0;
Method getPageData
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getPageData(string $type, Page $page): array
{
$categories = $page->getCategories();
$paths = [];
$isVisible = false;
Function getTransactionData
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function getTransactionData(string $orderId): stdClass
{
foreach (['PAYMENT_CAPTURED', 'PAYMENT_NEW', 'PAYMENT_DELETED'] as $status) {
$response = $this->getConnection()->gettransactionlist($this->getSearchData($orderId, $status));
if ($response instanceof stdClass) {
- 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
Category
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Category extends AbstractRenderable
{
use HasIcon;
/** Table name in database. */
File InvoiceController.php
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers\Admin;
use App\Countries;
ExplorerController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ExplorerController extends AbstractAdminController
{
private FileService $fileService;
public function __construct()
File ExportController.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers\Admin;
use App\Enums\ColumnType;
Method rss
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rss(Request $request): Response
{
$db = app(DbService::class);
$db->addLoadedTable('bind', 'files', 'kat', 'maerke', 'sider');
File invoice.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xHttp from "../xHttp.js";
import {genericCallback, reloadCallback, getSelectValue} from "./javascript.js";
import {getAddress, changeZipCode} from "../getAddress.js";
var invoiceLines = [];
Method mismatchedBindings
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mismatchedBindings(): JsonResponse
{
$html = '';
// Map out active / inactive
File InvoicePdfService.php
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use App\Countries;
Function update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function update(Request $request, int $id): JsonResponse
{
$orm = app(OrmService::class);
$category = $orm->getOne(Category::class, $id);
- 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 generateFilterInvoiceBySelection
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function generateFilterInvoiceBySelection(InvoiceFilter $selected, User $user): string
{
if ($selected->id) {
return 'WHERE `id` = ' . $selected->id;
}
- 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 findPages
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findPages(
string $searchString,
int $brandId,
string $varenr = '',
int $minpris = 0,
Method getDbArray
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDbArray(): array
{
$itemQuantities = [];
$itemTitle = [];
$itemValue = [];
Method buildSearchQuery
has 58 lines of code (exceeds 25 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);
File Category.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Models;
use App\Exceptions\InvalidInput;
Function setItemData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function setItemData(string $itemData): self
{
$this->items = [];
$items = json_decode($itemData, true);
- 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 index
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(Request $request): Response
{
$momssats = strval($request->get('momssats'));
if (!$momssats) {
$momssats = null;