Showing 151 of 1,190 total issues
Function invoice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function invoice(Request $request, ?int $id = null): Response
{
$orm = app(OrmService::class);
$invoice = null;
- 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 listUpdateRowCallback
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function listUpdateRowCallback(data) {
if (!genericCallback(data)) {
return;
}
var cells = $("list_row" + data.rowid);
- 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 mapFromDB
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function mapFromDB(array $data): array
{
$columnSortings = explode('<', $data['sorts']);
$columnSortings = array_map('intval', $columnSortings);
$columnTypes = explode('<', $data['cells']);
- 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 getLastLoginText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getLastLoginText(): string
{
if (!$this->lastLogin) {
return _('Never');
}
- 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 getBillingAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getBillingAddress(array $countries): string
{
$address = $this->invoice->getName();
if ($this->invoice->getAttn()) {
$address .= "\n" . _('Attn.:') . ' ' . $this->invoice->getAttn();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function create(Request $request): RedirectResponse
{
$fullname = $request->get('fullname');
$name = $request->getRequestString('name') ?? '';
$password = $request->getRequestString('password') ?? '';
- 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 results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function results(Request $request): Response
{
if ($response = $this->checkSearchable($request)) {
return $response;
}
- 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 getPages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPages(string $order = 'navn'): array
{
if (!in_array($order, ['navn', 'for', 'pris', 'varenr'], true)) {
$order = 'navn';
}
- 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 addressSave
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addressSave(Request $request, int $id, string $checkId): Response
{
$invoice = app(OrmService::class)->getOne(Invoice::class, $id);
if ($redirect = $this->checkStatus($id, $checkId, $invoice)) {
return $redirect;
- 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 getContactFilterSQL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getContactFilterSQL(): string
{
$andWhere = '';
if ($this->interests) {
foreach ($this->interests as $interest) {
- 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 matchRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function matchRoute(string $method, string $requestUrl): callable
{
if ('HEAD' === $method) {
$method = 'GET';
}
- 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"