fannie/modules/plugins2.0/ShelfAudit/SaItemList.php
File SaItemList.php
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
Method getList
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getList()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($this->config->get('OP_DB'));
$uid = FannieAuth::getUID($this->current_user);
Function getList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getList()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($this->config->get('OP_DB'));
$uid = FannieAuth::getUID($this->current_user);
- 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_dateID_view
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function get_dateID_view()
{
$opts = array();
$lbls = array();
for ($i=0; $i<12; $i++) {
Method exportList
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function exportList($set=1)
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$this->connection->selectDB($this->config->get('OP_DB'));
$uid = FannieAuth::getUID($this->current_user);
Method get_view
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get_view()
{
$elem = '#upc_in';
if (isset($this->current_item_data['upc']) && isset($this->current_item_data['desc'])) $elem = '#cur_qty';
$this->addOnloadCommand('$(\'#upc_in\').focus();');
Method get_id_handler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function get_id_handler()
{
$dbc = $this->connection;
$settings = $this->config->get('PLUGIN_SETTINGS');
$uid = FannieAuth::getUID($this->current_user);
Function get_id_handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function get_id_handler()
{
$dbc = $this->connection;
$settings = $this->config->get('PLUGIN_SETTINGS');
$uid = FannieAuth::getUID($this->current_user);
- 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"