Showing 8,683 of 8,684 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected $columns = array(
'empID' => array('type'=>'INT', 'primary_key'=>true),
'periodID' => array('type'=>'INT', 'primary_key'=>true),
'year' => array('type'=>'SMALLINT', 'index'=>true),
'hours' => array('type'=>'DOUBLE'),
- 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 141.
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
if ($w['discounttype'] == 1 || $w['discounttype'] == 2) {
$ret .= '<td id="discPercent'.$w['trans_id'].'">Sale</td>';
} else if ($w['regPrice'] != $w['total']) {
$ret .= sprintf('<td id="discPercent%d">%d%%</td>',$w['upc'],
round(100*(($w['regPrice']-$w['total'])/$w['regPrice'])));
- 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 141.
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
protected $columns = array(
'date_id' => array('type'=>'INT', 'primary_key'=>true),
'emp_no' => array('type'=>'SMALLINT', 'index'=>true),
'trans_num' => array('type'=>'VARCHAR(25)', 'primary_key'=>true),
'startTime' => array('type'=>'DATETIME'),
- 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 141.
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 stChart
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
var stChart = (function() {
var mod = {};
var _fontSize = 12;
Method head_content
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function head_content()
{
$url = MiscLib::baseURL();
echo '<script type="text/javascript" src="' . $url . '/js/singleSubmit.js"></script>';
echo '<script type="text/javascript" src="../js/emv.js?date=20210325"></script>';
Method sendAuth
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sendAuth()
{
$this->GATEWAY = 'https://api.payeezy.com/v1/transactions';
$this->GATEWAY = 'https://api.globalgatewaye4.firstdata.com/transaction/v32';
if ($this->conf->get("training") == 1) {
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 process_file
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_file($linedata, $indexes)
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$this->setupTables($dbc);
Method fetch_report_data
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
try {
$upc = $this->form->upc;
} catch (Exception $ex) {
File AuthUsersPage.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2009 Whole Foods Co-op
Method javascriptContent
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function javascriptContent()
{
return <<<JAVASCRIPT
$('textarea').each(function(){
var text = $(this).text();
Method generateMirrorBulk_RepackTag
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateMirrorBulk_RepackTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc)
{
$upc = isset($row['upc']) ? $row['upc'] : '';
$description = isset($row['description']) ? $row['description'] : '';
$brand = isset($row['brand']) ? $row['brand'] : '';
Method fetch_report_data
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$info = FormLib::standardItemFromWhere();
Method run
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$settings = $this->config->PLUGIN_SETTINGS;
$dbc = FannieDB::get($settings['TargetedPromosDB']);
$warehouse = $settings['WarehouseDatabase'];
Method smoothDay
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function smoothDay($date)
{
/**
* Skip future dates to avoid piling on zero-sales days
*/
Method preprocess
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocess(){
global $FANNIE_URL,$FANNIE_PLUGIN_LIST,$FANNIE_PLUGIN_SETTINGS;
if (!isset($FANNIE_PLUGIN_LIST) || !in_array('CoopCred', $FANNIE_PLUGIN_LIST)) {
Method process_file
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_file($linedata, $indexes)
{
$VENDOR_ID = $this->getVendorID();
if ($VENDOR_ID === false) {
$this->error_details = 'Cannot find vendor';
Method process_file
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process_file($linedata, $indexes)
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$VENDOR_ID = $this->getVendorID();
Method get_id_view
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_view()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method showEditForm
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showEditForm($memNum, $country="US")
{
$account = self::getAccount();
$primary = array();
foreach ($account['customers'] as $c) {