File InvCountPage.php
has 564 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2015 Whole Foods Community Co-op
Method get_vendor_view
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_vendor_view()
{
try {
$store = $this->form->store;
} catch (Exception $ex) {
Method get_live_view
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_live_view()
{
try {
$store = $this->form->store;
} catch (Exception $ex) {
Method get_view
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$vendors = new VendorsModel($this->connection);
$supers = new SuperDeptNamesModel($this->connection);
$stores = FormLib::storePicker('store', false);
Method get_id_view
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_view()
{
$upc = BarcodeLib::padUPC($this->id);
$store = FormLib::get('store', 1);
$info = $this->getMostRecent($upc, $store);
Function post_vendor_handler
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function post_vendor_handler()
{
try {
$upc = $this->form->upc;
$count = $this->form->count;
- 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 get_vendor_view
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function get_vendor_view()
{
try {
$store = $this->form->store;
} catch (Exception $ex) {
- 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 get_live_view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function get_live_view()
{
try {
$store = $this->form->store;
} catch (Exception $ex) {
- 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"