Showing 8,683 of 8,684 total issues
Method doc
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doc()
{
return '
Use:
WFC runs custom barcoded coupons with
Method get_view
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$ret = '';
Method get_view
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$dbc = $this->connection;
//$nutriCols = array("servingSize","calories","fatCalories","totalFat","saturatedFat","transFat","cholesterol","sodium","totalCarbs","fiber","sugar","addedSugar","protein");
Method body_content
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function body_content()
{
$ingrHead = FormLib::get("ingrHead", '');
$ingrCheck = ($ingrHead == 1) ? ' checked ' : '';
Identical blocks of code found in 2 locations. Consider refactoring. Open
else if (s.Substring(0,4) == "S08A" ||
s.Substring(0,4) == "S08F")
return s.Substring(4);
else if (s.Substring(0,4) == "S08E")
return this.ExpandUPCE(s.Substring(4));
- 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 207.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
else if (s.Substring(0,4) == "S08A" ||
s.Substring(0,4) == "S08F")
return s.Substring(4);
else if (s.Substring(0,4) == "S08E")
return this.ExpandUPCE(s.Substring(4));
- 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 207.
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
Function initState
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
mod.initState = function(s) {
if (typeof s == 'object') {
state = s;
if (state['onHand'].__proto__ == Array.prototype) {
state['onHand'] = {};
Method printfooter
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function printfooter($readOnly=False)
{
$FOOTER_MODULES = CoreLocal::get("FooterModules");
// use defaults if modules haven't been configured
// properly
Method fetch_report_data
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
Method preprocess
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preprocess()
{
global $FANNIE_OP_DB, $FANNIE_STORE_MODE, $FANNIE_STORE_ID;
$model = new StoresModel(FannieDB::get($FANNIE_OP_DB));
$posted = false;
Method report_description_content
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function report_description_content()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$dbc = FannieDB::get($settings['HrWebDB']);
$ret = array();
Method fetch_report_data
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
$dt = FormLib::get('endDate', date('Y-m-d'));
Method addItems
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addItems($dbc, $orderID, $items, $cardNo)
{
$PENDING = FannieDB::fqn('PendingSpecialOrder', 'trans');
$tidP = $dbc->prepare("SELECT MAX(trans_id),MAX(voided),MAX(numflag)
FROM {$PENDING} WHERE order_id=?");
Method get_id_view
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_view()
{
$dbc = $this->connection;
$settings = $this->config->get('PLUGIN_SETTINGS');
$dbc->selectDB($settings['VolunteerHoursDB']);
Method drawPDF
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawPDF()
{
$pdf = $this->createPDF();
$dbc = FannieDB::get(FannieConfig::config('OP_DB'));
$basicP = $dbc->prepare("SELECT
Method printTags
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function printTags($tags)
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$TRANS = $this->config->get('TRANS_DB').$dbc->sep();
Method post_upc_discounttype_handler
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_upc_discounttype_handler()
{
$discountType = FormLib::get('discounttype');
$isMember = FormLib::get('isMember');
$id = FormLib::get('orderid');
Method bodyContent
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bodyContent()
{
ob_start();
$dbc = $this->connection;
$dbc->selectDB($this->config->get('TRANS_DB'));
Method get_view
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
Method SaveFormData
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function SaveFormData($upc)
{
try {
$likecode = $this->form->likeCode;
} catch (Exception $ex) {