File VendorIndexPage.php
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2009,2013 Whole Foods Co-op
Method getVendorInfo
has 278 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getVendorInfo($id)
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$ret = "";
$noEdit = !$this->canEdit ? 'disabled' : '';
Function getVendorInfo
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function getVendorInfo($id)
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$ret = "";
$noEdit = !$this->canEdit ? 'disabled' : '';
- 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 helpContent
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function helpContent()
{
return '<p>Vendors are the entities the store purchases its
products from. The most important data associated with
a vendor is their catalog of items. A product that the store
Method autoPopulate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function autoPopulate($vendorID)
{
if (!$this->canEdit) return false;
$dbc = FannieDB::get($this->config->get('OP_DB'));
Method get_view
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$vendors = "<option value=\"\">Select a vendor...</option>";
$vendors .= "<option value=\"new\">New vendor...</option>";
Method post_info_handler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_info_handler()
{
if (!$this->canEdit) return false;
$id = FormLib::get('vendorID','');
if ($id === '') {
Function get_view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function get_view()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$vendors = "<option value=\"\">Select a vendor...</option>";
$vendors .= "<option value=\"new\">New vendor...</option>";
- 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 post_info_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function post_info_handler()
{
if (!$this->canEdit) return false;
$id = FormLib::get('vendorID','');
if ($id === '') {
- 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"