File MovementTagTracker.php
has 740 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2015 Whole Foods Co-op
Method get_id_view
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_view()
{
$storepicker = FormLib::storePicker();
$save = FormLib::get('save');
$dbc = FannieDB::get($this->config->get('OP_DB'));
Method get_data_view
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_data_view()
{
$dbc = Fanniedb::get($this->config->get('op_db'));
$storeID = FormLib::get('store', false);
Function draw_table
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function draw_table($storeName, $storeID)
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$params = array();
$prep = $dbc->prepare("SELECT * FROM MovementTrackerParams");
- 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 draw_table
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function draw_table($storeName, $storeID)
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$params = array();
$prep = $dbc->prepare("SELECT * FROM MovementTrackerParams");
Method get_view
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$storeID = COREPOS\Fannie\API\lib\Store::getIdByIp();
$ret = "";
Method get_replacetags
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function get_replacetags($storeID, $volMin, $volMax, $posLimit, $negLimit)
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$date = new DateTime();
$date->sub(new DateInterval('P1M'));
Function get_data_view
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get_data_view()
{
$dbc = Fanniedb::get($this->config->get('op_db'));
$storeID = FormLib::get('store', 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
Method draw_expired_table
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function draw_expired_table()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$storeID = COREPOS\Fannie\API\lib\Store::getIdByIp();
$date = new DateTime();
Function get_id_view
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function get_id_view()
{
$storepicker = FormLib::storePicker();
$save = FormLib::get('save');
$dbc = FannieDB::get($this->config->get('OP_DB'));
- 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_upcs_handler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_upcs_handler()
{
$dbc = fanniedb::get($this->config->get('op_db'));
$upcs = FormLib::get('upcs');
$adjustments = FormLib::get('adjustments');
Method get_exclusionName_handler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_exclusionName_handler()
{
$dbc = fanniedb::get($this->config->get('op_db'));
$name = FormLib::get('exclusionName');
$dept = FormLib::get('addDepartment');
Method get_addRange_handler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_addRange_handler()
{
$start = FormLib::get('start');
$end = FormLib::get('end');
$change = FormLib::get('change');
Function post_upcs_handler
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function post_upcs_handler()
{
$dbc = fanniedb::get($this->config->get('op_db'));
$upcs = FormLib::get('upcs');
$adjustments = FormLib::get('adjustments');
- 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 get_replacetags
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function get_replacetags($storeID, $volMin, $volMax, $posLimit, $negLimit)
Function get_exclusionName_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_exclusionName_handler()
{
$dbc = fanniedb::get($this->config->get('op_db'));
$name = FormLib::get('exclusionName');
$dept = FormLib::get('addDepartment');
- 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"