Showing 8,683 of 8,684 total issues
Method get_id_handler
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_handler()
{
if (!class_exists('GumCheckTemplate')) {
echo 'Missing check template; enable plugin!';
return false;
Class JsonTextReader
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
public class JsonTextReader : JsonReader, IJsonLineInfo
{
private const char UnicodeReplacementChar = '\uFFFD';
private const int MaximumJavascriptIntegerCharacterLength = 380;
Method get_view
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$this->addScript($this->config->get('URL') . 'src/javascript/Chart.min.js');
$this->addScript('cwDash.js');
$settings = $this->config->get('PLUGIN_SETTINGS');
Method preprocess
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preprocess()
{
$this->display_function = 'listHouseCoupons';
$msgs = array();
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2014 Whole Foods Co-op
Copyright 2014 West End Food Co-op, Toronto
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 213.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2014 Whole Foods Co-op
Copyright 2014 West End Food Co-op, Toronto
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 213.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method javascript_content
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function javascript_content()
{
return <<<JAVASCRIPT
var uniqTable = document.getElementById('uniq-table');
var currentRow = 2;
Method javascript_content
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function javascript_content()
{
return <<<JAVASCRIPT
var uniqTable = document.getElementById('uniq-table');
var currentRow = 2;
Method post_u_view
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
function post_u_view()
{
global $FANNIE_OP_DB, $FANNIE_URL;
$this->addScript('from-search.js');
File StatementsPluginEmail.php
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use COREPOS\Fannie\API\data\pipes\OutgoingEmail;
include_once(dirname(__FILE__) . '/../../../config.php');
Method fetchReportData
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetchReportData($report_class_name, \FannieConfig $config, \SQLManager $connection)
{
$date1 = \FormLib::get_form_value('date1',date('Y-m-d'));
if ($date1 == date('Y-m-d')) {
// warehouse cannot handle current day requests
Function getItemData
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private function getItemData($arr)
{
$ret = '';
/**
Convert balance to a more useful format.
- 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 check
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function check($str)
{
$myUrl = MiscLib::baseURL();
$this->ret = $this->default_json();
- 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 addItem
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function addItem(array $row, $quantity, $priceObj)
{
if ($quantity == 0) return false;
$pricing = $priceObj->priceInfo($row,$quantity);
- 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_id_view
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function get_id_view()
{
$this->addScript($this->config->get('URL') . 'src/javascript/jquery.floatThead.min.js');
$this->addScript('pricing-batch.js');
$dbc = $this->connection;
- 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 getTopImage
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private function getTopImage($item)
{
// Manual Signs Page && smartType override checked takes precedence
if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
return __DIR__ . '/noauto/images/codeals_top_2.png';
- 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 getTopImage
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private function getTopImage($item)
{
// Manual Signs Page && smartType override checked takes precedence
if (isset($item['smartType']) && $item['smartType'] == 'CoopDeals') {
return __DIR__ . '/noauto/images/codeals_top_2.png';
- 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_month_upc_view
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function get_month_upc_view($month=false)
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
if (FormLib::get('linea') != 1) {
- 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_id_view
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_view()
{
global $FANNIE_OP_DB;
$ret = $this->get_view();
$upc = BarcodeLib::padUPC($this->id);
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($item['organicLocal']) {
$pdf->Image(__DIR__ . '/noauto/og-loc.png', $x-2, $y, 80, 15);
$rgb = array(151,201,61);
} elseif ($item['organic']) {
$pdf->Image(__DIR__ . '/noauto/og.png', $x-2, $y, 80, 15);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 212.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76