Showing 8,683 of 8,684 total issues
Method listHouseCoupons
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function listHouseCoupons()
{
$FANNIE_URL = $this->config->get('URL');
$this->addScript($FANNIE_URL . 'src/javascript/fancybox/jquery.fancybox-1.3.4.js?v=1');
Method preprocess
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocess(){
global $FANNIE_AR_DEPARTMENTS;
global $FANNIE_EQUITY_DEPARTMENTS;
global $FANNIE_OP_DB;
global $FANNIE_EMP_NO, $FANNIE_REGISTER_NO;
Method get_upc_view
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_upc_view()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$newUpc = FormLib::get('newUpc', false);
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (count(isset($locations[$upc]) ? $locations[$upc] : array()) > 1 && $store == 2) {
$pdf->SetFillColor(255, 100, 0); // orange
$pdf->Circle($baseX+27.5, $baseY-7.5, 1.25, 'F');
$pdf->SetTextColor(255,255,255);
$pdf->SetFontSize(6);
- 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 159.
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
if (count(isset($locations[$upc]) ? $locations[$upc] : array()) > 1 && $store == 2) {
$pdf->SetFillColor(255, 100, 0); // orange
$pdf->Circle($baseX+27.5, $baseY-7.5, 1.25, 'F');
$pdf->SetTextColor(255,255,255);
$pdf->SetFontSize(6);
- 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 159.
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
Class JsonValidatingReader
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
public class JsonValidatingReader : JsonReader, IJsonLineInfo
{
private class SchemaScope
{
private readonly JTokenType _tokenType;
Class NativeMethods
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
static class NativeMethods
{
const string Libusb = "libusb-1.0";
public struct DeviceDescriptor
Class NativeMethods
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
static class NativeMethods
{
const string libc = "libc";
const string libudev = "libudev";
Method run
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
// clean cache
$this->cleanFileCache();
Method WFC_Old
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WFC_Old($data,$offset=0){
$pdf=new WFC_Old_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 WFC_Standard
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WFC_Standard($data,$offset=0){
$pdf=new WFC_Standard_PDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
$pdf->SetTopMargin(40); //Set top margin of the page
File MailChimpTask.php
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op
Method get_id_loanstatement_handler
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_loanstatement_handler()
{
global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
$loan = new GumLoanAccountsModel($dbc);
Method import
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function import($filename, $vendorID, $repeat=false)
{
echo $filename . "\n";
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method htmlLine
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function htmlLine($row, $header=False)
{
$url = $this->config->get('URL');
$meta = 0;
if (isset($row['meta'])) {
Method pricePerUnit
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pricePerUnit($price,$sizeStr)
{
$country = \FannieConfig::factory()->get('COUNTRY', 'US');
$num = "";
Method showCategoryItems
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showCategoryItems($vid,$did,$brand,$ds=-999)
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method get_view
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
// for now, only denfeld is being shown
Method ProcessSchemaProperties
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void ProcessSchemaProperties(JObject schemaObject)
{
foreach (KeyValuePair<string, JToken> property in schemaObject)
{
switch (property.Key)
File ItemMarginModule.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op, Duluth, MN