File Shoppingcart.php
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
HCSF - A multilingual CMS and Shopsystem
Copyright (C) 2014 Marcus Haase - mail@marcus.haase.name
Function getNotification
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function getNotification()
{
$return = '';
$getmsg = filter_input(INPUT_GET, 'msg');
$getcartkey = filter_input(INPUT_GET, 'cartkey', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
- 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 buildOrderMailBody
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildOrderMailBody($bCust = true, $iId)
{
$aM = [
'customdata' => $this->helperShop->buildShoppingCartTable($_SESSION['cart'], true),
'currency' => $this->config->getShop('waehrungssymbol'),
Function preparePage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function preparePage()
{
$this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
$this->P->cb_pagetype = 'contentnosubnav';
- 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 getItemImage
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getItemImage($aV)
{
// base64 encode img and prepare for db
// image/png image/jpeg image/gif
// data:{mimetype};base64,XXXX
Method prepareDataOrder
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prepareDataOrder()
{
$cartpricesums = $_SESSION['cartpricesums'];
return [
'o_custno' => filter_var(trim(Tools::getFormfield('custno')), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW),
Method getNotification
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getNotification()
{
$return = '';
$getmsg = filter_input(INPUT_GET, 'msg');
$getcartkey = filter_input(INPUT_GET, 'cartkey', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
Method sendCheckoutMails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sendCheckoutMails($iInsertID, $sMailbody_us, $sMailbody_they)
{
$aFilesToSend = [];
if (
!empty($this->config->getShop('email_orderconfirmation_attachment_cancellationform_'.$this->config->getLang()))
Function getItemImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getItemImage($aV)
{
// base64 encode img and prepare for db
// image/png image/jpeg image/gif
// data:{mimetype};base64,XXXX
- 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"