File ManualSignsPage.php
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2015 Whole Foods Co-op
Method get_view
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$ret = '';
$ret .= '<form target="_blank" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
$mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
Method formTableHeader
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formTableHeader()
{
if (FannieConfig::config('COOP_ID') == 'WFC_Duluth') {
$ret = SignsLib::visualSignSelectHTML();
$this->addOnloadCommand(SignsLib::visualSignSelectJS());
Function get_queueID_handler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function get_queueID_handler()
{
$prep = $this->connection->prepare('
SELECT p.upc,
' . ItemText::longBrandSQL() . ',
- 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 post_handler
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_handler()
{
$brands = FormLib::get('brand');
$descriptions = FormLib::get('description');
$prices = FormLib::get('price');
Method get_queueID_handler
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_queueID_handler()
{
$prep = $this->connection->prepare('
SELECT p.upc,
' . ItemText::longBrandSQL() . ',
Function get_view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function get_view()
{
$ret = '';
$ret .= '<form target="_blank" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
$mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
- 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 formTableBody
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formTableBody($items)
{
$max = count($items) > 32 ? count($items) : 32;
$ret = '';
for ($i=0; $i<$max; $i++) {
Function post_handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function post_handler()
{
$brands = FormLib::get('brand');
$descriptions = FormLib::get('description');
$prices = FormLib::get('price');
- 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"