AJenbo/agcms

View on GitHub

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;
Severity: Minor
Found in application/inc/Http/Controllers/Admin/InvoiceController.php - About 25 mins to fix

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);
Severity: Minor
Found in source/javascript/admin/list.js - About 25 mins to fix

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']);
Severity: Minor
Found in application/inc/Models/Table.php - About 25 mins to fix

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');
        }
Severity: Minor
Found in application/inc/Models/User.php - About 25 mins to fix

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();
Severity: Minor
Found in application/inc/Services/InvoicePdfService.php - About 25 mins to fix

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') ?? '';
Severity: Minor
Found in application/inc/Http/Controllers/Admin/UserController.php - About 25 mins to fix

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;
        }
Severity: Minor
Found in application/inc/Http/Controllers/Search.php - About 25 mins to fix

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';
        }
Severity: Minor
Found in application/inc/Models/Brand.php - About 25 mins to fix

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;
Severity: Minor
Found in application/inc/Http/Controllers/Payment.php - About 25 mins to fix

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) {
Severity: Minor
Found in application/inc/Models/Newsletter.php - About 25 mins to fix

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';
        }
Severity: Minor
Found in application/inc/Application.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language