Function preprocess
has a Cognitive Complexity of 139 (exceeds 5 allowed). Consider refactoring. Open
public function preprocess()
{
$col_select = \FormLib::get_form_value('cs','');
$this->finishPreviewOpts();
- 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
File FannieUploadPage.php
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
Method preprocess
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preprocess()
{
$col_select = \FormLib::get_form_value('cs','');
$this->finishPreviewOpts();
Function processUpload
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected function processUpload()
{
/* use a dedicated temp directory */
$tpath = sys_get_temp_dir().'/fannie/';
if (!is_dir($tpath)) {
- 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 processUpload
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processUpload()
{
/* use a dedicated temp directory */
$tpath = sys_get_temp_dir().'/fannie/';
if (!is_dir($tpath)) {
Function basicPreview
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function basicPreview()
{
$ret = '<h3>Select columns</h3>';
/* show any errors */
if ($this->error_details != 'n/a' && $this->error_details != '') {
- 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
FannieUploadPage
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class FannieUploadPage extends \FanniePage
{
public $required = true;
Method basicPreview
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function basicPreview()
{
$ret = '<h3>Select columns</h3>';
/* show any errors */
if ($this->error_details != 'n/a' && $this->error_details != '') {
Method javascript_content
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function javascript_content()
{
ob_start();
?>
$(document).ready(function(){
Function finishPreviewOpts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function finishPreviewOpts()
{
foreach ($this->preview_opts as $k=>$v) {
if (!isset($this->preview_opts[$k]['name'])) {
$this->preview_opts[$k]['name'] = $k;
- 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 ajaxContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function ajaxContent()
{
$ret = '<div id="progressDiv">
<span id="uploadingSpan"></span><span id="numLines"></span><br />
<span id="progressSpan"></span><span id="numRecords"></span><br />
- 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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
$url .= array_reduce($col_select, function($carry, $item){ return $carry . 'cs[]=' . $item . '&'; }, '');
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
$url .= array_reduce($files, function($carry, $item){ return $carry . 'f[]=' . $item . '&'; }, '');
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return array();
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;