Showing 151 of 1,190 total issues
Function findPages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function findPages(
string $searchString,
int $brandId,
string $varenr = '',
int $minpris = 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
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
array $query = [],
array $request = [],
array $attributes = [],
array $cookies = [],
array $files = [],
Method findPages
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $searchString,
int $brandId,
string $varenr = '',
int $minpris = 0,
int $maxpris = 0,
Function circularLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function circularLinks(): JsonResponse
{
$html = '';
$categories = app(OrmService::class)->getByQuery(Category::class, 'SELECT * FROM `kat` WHERE bind != 0 AND bind != -1');
- 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 isNoOp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isNoOp(): bool
{
if ($this->cropW !== $this->image->getWidth() || $this->cropH !== $this->image->getHeight()) {
return false;
}
- 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 removeFromCategory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function removeFromCategory(Request $request, int $id, int $categoryId): JsonResponse
{
$orm = app(OrmService::class);
$page = $orm->getOne(Page::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 status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function status(Request $request, int $id, string $checkId): Response
{
$invoice = app(OrmService::class)->getOne(Invoice::class, $id);
if (!$invoice || $checkId !== $invoice->getCheckId()) {
return redirect('/betaling/?id=' . $id . '&checkid=' . rawurlencode($checkId), Response::HTTP_SEE_OTHER);
- 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 search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function search(Request $request): JsonResponse
{
$returnType = $request->query->get('return');
if (!is_string($returnType)) {
$returnType = '';
- 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 report
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function report(Throwable $exception): void
{
$this->lastLogId = null;
if (!$this->shouldLog($exception)) {
return;
- 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
Avoid deeply nested control flow statements. Open
if ($data instanceof stdClass) {
return $data;
}
Function image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function image(Request $request, int $id): Response
{
$file = app(OrmService::class)->getOne(File::class, $id);
if (!$file) {
throw new InvalidInput(_('File not found.'), Response::HTTP_NOT_FOUND);
- 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 getOneByQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getOneByQuery(string $class, string $query): ?AbstractEntity
{
$query = preg_replace('/\s+/u', ' ', $query);
if (null === $query) {
throw new Exception('preg_replace failed');
- 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 request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
"request": function(uri, callback, method, data) {
const id = xHttp.requests.length;
const x = new window.XMLHttpRequest();
x.responseType = "json";
- 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
Consider simplifying this complex logical expression. Open
if (x.status < 200 || x.status > 299 || x.response.error) {
const message = (x.response && x.response.error && x.response.error.message) || x.statusText;
alert("Error: " + message);
}
Function getAddressCallback1
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getAddressCallback1(responce) {
if (responce.error) {
return;
}
if (responce.name) {
- 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 sendInvoice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function sendInvoice(Invoice $invoice): void
{
if (!$invoice->hasValidEmail()) {
throw new InvalidInput(_('Email is not valid.'));
}
- 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 getByQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getByQuery(string $class, string $query): array
{
$query = preg_replace('/\s+/u', ' ', $query);
if (null === $query) {
throw new Exception('preg_replace failed');
- 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 removeNoneExistingFiles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function removeNoneExistingFiles(): JsonResponse
{
$files = app(OrmService::class)->getByQuery(File::class, 'SELECT * FROM `files`');
$app = app();
- 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 getAddressCallback2
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getAddressCallback2(responce) {
if (responce.error) {
return;
}
if (responce.name) {
- 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 folderRename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function folderRename(Request $request): JsonResponse
{
$path = $request->getRequestString('path') ?? '';
$name = $request->getRequestString('name') ?? '';
$name = $this->fileService->cleanFileName($name);
- 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"