Showing 138 of 151 total issues
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
Function prepareSuggestions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function prepareSuggestions($sSetSuggestions, array $aPossibleSuggestions, Items $oItem)
{
// prepare defined suggestions
$sSetSuggestions = trim($sSetSuggestions);
$aDefinedSuggestions = [];
- 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 handleAddPage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function handleAddPage()
{
$aErr = [];
if (filter_input(INPUT_POST, 'addpage') === 'do') {
$sPagekeytoadd = trim(filter_input(INPUT_POST, 'pagekey', FILTER_SANITIZE_SPECIAL_CHARS));
- 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 showMyOrders
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showMyOrders($COList)
{
$return = '';
$sql = 'SELECT * FROM orders WHERE o_custno = :custno ORDER BY o_ordertimestamp DESC';
Method prepareItem
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prepareItem($aItemdata)
{
$aData = [
'form' => ['action' => Tools::makeLinkHRefWithAddedGetVars('/_admin/itemadmin.html', ['action' => 'showitem', 'itemno' => $aItemdata['base']['itm_no']]),],
'id' => $aItemdata['base']['itm_id'],
Method mailWrapper
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mailWrapper($to, $subject = '(No subject)', $message = '', $aImagesToEmbed = [], $aFilesToAttach = []) {
$mail = new \PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->isMail();
Method loadNavigation
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadNavigation(ServiceManager $serviceManager)
{
if (is_file(PATH_BASEDIR.'config/navigation.yml')) {
$navstruct = Yaml::parse(file_get_contents(PATH_BASEDIR.'config/navigation.yml'));
} else {
Method seekItem
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function seekItem(\HaaseIT\HCSF\Page $P, array $aP, Items $oItem)
{
// Change pagetype to itemoverview, will be changed back to itemdetail once the item is found
// if it is not found, we will show the overview
$aP['pagetype'] = 'itemoverview';
Function calcPrice
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function calcPrice($aData)
{
$aPrice = [];
if ($aData['itm_vatid'] !== 'reduced') {
$aData['itm_vatid'] = 'full';
- 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 requireAdminAuth
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function requireAdminAuth() {
$adminusers = $this->config->getSecret('admin_users');
if ($this->requireAdminAuthAdminHome && (empty($adminusers) || !count($adminusers))) {
return 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
Function __construct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(ServiceManager $serviceManager, $iParentID, $bReturnRaw = false, UserPage $basePage = null) {
parent::__construct($serviceManager);
$this->dbal = $this->serviceManager->get('dbal');
- 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 sortItems
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sortItems($mItemIndex = '', $mItemno = '', $bEnableItemGroups = false)
{
if ($mItemno !== '') {
if (\is_array($mItemno)) {
$TMP = [];
Method preparePage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preparePage()
{
$this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
$this->P->cb_pagetype = 'content';
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 getItemlist
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getItemlist()
{
$sSearchstring = filter_input(INPUT_GET, 'searchstring', FILTER_SANITIZE_SPECIAL_CHARS);
$sSearchstring = str_replace('*', '%', $sSearchstring);
Method prepareSuggestions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareSuggestions($sSetSuggestions, array $aPossibleSuggestions, Items $oItem)
{
// prepare defined suggestions
$sSetSuggestions = trim($sSetSuggestions);
$aDefinedSuggestions = [];
Method handleItems
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleItems()
{
if (filter_input(INPUT_GET, 'clearorphaneditems') !== null) {
$this->db->exec('DELETE FROM item_lang WHERE itml_pid NOT IN (SELECT itm_id FROM item_base)');
}
Function getUserData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getUserData($sField = '', $aUserdata = false)
{
if (!$aUserdata) {
if (!isset($_SESSION['user']) || !is_array($_SESSION['user'])) {
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 setupSession
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function setupSession()
{
if (
(
$this->config->getCore('enable_module_customer')
- 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"