Showing 8,683 of 8,684 total issues
Method YPSI_BulkLabel
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
function YPSI_BulkLabel($data,$offset=0){
$pdf=new YPSI_BulkLabel_PDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
$pdf->SetTopMargin(40); //Set top margin of the page
Method post_handler
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_handler()
{
$dateID = str_replace('-', '', FormLib::get('date'));
$ref =trim(FormLib::get('ref'));
$xml = trim(FormLib::get('xml'));
Method get_orders
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_orders($placed, $store=0, $month=0, $year=0)
{
$dbc = $this->connection;
$store = FormLib::get('store', $store);
Method pushTable
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function pushTable($table,$db='op',$truncate=self::TRUNCATE_DESTINATION,$includeOffline=false)
{
$config = \FannieConfig::factory();
$op_db = $config->get('OP_DB');
$trans_db = $config->get('TRANS_DB');
Method TryParseDateIso
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
internal static bool TryParseDateIso(string text, DateParseHandling dateParseHandling, DateTimeZoneHandling dateTimeZoneHandling, out object dt)
{
DateTimeParser dateTimeParser = new DateTimeParser();
if (!dateTimeParser.Parse(text))
{
Similar blocks of code found in 2 locations. Consider refactoring. Open
while($w = $dbc->fetch_row($skuR)){
$result = array(
'sku' => $w['sku'],
'title' => '['.$w['vendorName'].'] '.$w['brand'].' - '.$w['description'],
'unitSize' => $w['size'],
- 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 150.
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
while($w = $dbc->fetch_row($upcR)){
$result = array(
'sku' => $w['sku'],
'title' => '['.$w['vendorName'].'] '.$w['brand'].' - '.$w['description'],
'unitSize' => $w['size'],
- 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 150.
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
File HobartDgwLib.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2014 Whole Foods Co-op, Duluth, MN
Method addItem
has 27 arguments (exceeds 4 allowed). Consider refactoring. Open
static private function addItem($strupc, $strdescription, $strtransType, $strtranssubType, $strtransstatus, $intdepartment, $dblquantity, $dblunitPrice, $dbltotal, $dblregPrice, $intscale, $inttax, $intfoodstamp, $dbldiscount, $dblmemDiscount, $intdiscountable, $intdiscounttype, $dblItemQtty, $intvolDiscType, $intvolume, $dblVolSpecial, $intmixMatch, $intmatched, $intvoided, $cost=0, $numflag=0, $charflag='')
File memlist.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2010 Whole Foods Co-op
File NutriFacts.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Community Co-op
Method wicReceiptHandler
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function wicReceiptHandler($dbc, $xml, $transID)
{
if ($xml->query('/RStream/TranResponse/TranCode') == 'ReverseSale') {
$clearP = $dbc->prepare('DELETE FROM EmvReceipt WHERE dateID=? AND empNo=? AND registerNo=? AND transNo=? AND transID=?');
$dbc->execute($clearP, array(
Method sendAuth
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendAuth()
{
$dbTrans = PaycardLib::paycard_db();
if( !$dbTrans){
$this->conf->reset();
Method voidupc
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function voidupc($upc, $json, $itemNum=-1)
{
$deliflag = false;
$quantity = 0;
Method run
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$dbc = FannieDB::get($this->config->get('TRANS_DB'));
$date = date('Y-m-d', strtotime('yesterday'));
$dlog = DTransactionsModel::selectDlog($date);
Method body_content
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function body_content()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$transDB = $this->config->get('TRANS_DB') . $dbc->sep();
Method post_id_handler
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_handler()
{
$shelfLife = FormLib::get('shelfLife', false);
list($inStr, $args) = $this->connection->safeInClause($this->id);
$map = array();
Method drawPDF
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawPDF($dbc)
{
$keySize = 15;
$pdf = new FPDF('P', 'mm', 'Letter');
Method indexView
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function indexView($uid)
{
global $FANNIE_URL;
$yours = CalendarPluginPermissions::get_own_calendars($uid);
$theirs = CalendarPluginPermissions::get_other_calendars($uid);
Method post_id_handler
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_handler()
{
$section = FormLib::get('section');
$store = COREPOS\Fannie\API\lib\Store::getIdByIp();
$super = FormLib::get('super');