fannie/item/images/NutriFactEntry.php
Method javascriptContent
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function javascriptContent()
{
$dbc = $this->connection;
$json = array();
$prep = $dbc->prepare("SELECT * FROM NutriFactStd");
File NutriFactEntry.php
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Community Co-op
Method get_view
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get_view()
{
$dbc = $this->connection;
//$nutriCols = array("servingSize","calories","fatCalories","totalFat","saturatedFat","transFat","cholesterol","sodium","totalCarbs","fiber","sugar","addedSugar","protein");
Method post_nutrient_handler
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function post_nutrient_handler()
{
$dbc = $this->connection;
$mode = FormLib::get('nutrient');
$upc = FormLib::get('upc');
Method post_nutriFacts_handler
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function post_nutriFacts_handler()
{
$upc = FormLib::get('upc');
$upc = BarcodeLib::padUPC($upc);
$dbc = $this->connection;
Method post_id_handler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function post_id_handler()
{
$col = FormLib::get('col');
$upc = FormLib::get('upc');
$val = FormLib::get('val');
Function post_nutrient_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function post_nutrient_handler()
{
$dbc = $this->connection;
$mode = FormLib::get('nutrient');
$upc = FormLib::get('upc');
- 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"