Showing 8,683 of 8,684 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
mod.saveNotes = function(batchID) {
var dstr = $('#batchNotes').serialize() + '¬eID=' + batchID;
$.ajax({
type: 'post',
data: dstr
- 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 78.
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 FannieCRUDPage.php
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2015 Whole Foods Co-op
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($item['locAbbr']) && $item['transLimit'] == 0) {
$pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
$pdf->SetXY($this->left + ($this->width*$column) + 14, $this->top + ($this->height*$row) + ($this->height - 42));
$pdf->Cell($effective_width, 20, " ".$item['locAbbr'], 0, 1, 'L');
}
- 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 124.
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 (isset($item['locAbbr']) && $item['transLimit'] == 0) {
$pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
$pdf->SetXY($this->left + ($this->width*$column) + 14, $this->top + ($this->height*$row) + ($this->height - 33));
$pdf->Cell($effective_width, 20, " ".$item['locAbbr'], 0, 1, 'L');
}
- 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 124.
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 piJS
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var piJS = (function($) {
var mod = {};
var extractFields = function(data) {
var pieces = data.split("^");
Function salesToday
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var salesToday = (function($) {
var mod = {};
mod.reloadGraph = function() {
var url='SalesTodayReport.php?';
Method handleResponseVoid
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleResponseVoid($authResult)
{
$resp = $this->desoapify("CreditTransactionResult",
$authResult["response"]);
$xml = new XmlData($resp);
Method preprocess
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocess()
{
$entered = $this->getInput();
if ($entered === false) {
return true;
Method getCCredSubtotals
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function getCCredSubtotals($tender, $conn,
$programCode='', $table='', $ref='')
{
global $CORE_LOCAL;
Method doc
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doc()
{
return '
Use:
This is one of two "primary" tables dealing with membership
Method deptOpenRing
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function deptOpenRing($dept, $price, $discount, $ret)
{
list($ret, $memberOnly) = $this->memberOnlyDept($dept, $ret);
if ($memberOnly === true) {
return $ret;
Method run
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$today = date('Y-m-d');
$now = new DateTime();
Method get_id_view
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_id_view()
{
$this->addScript($this->config->get('URL') . 'src/javascript/chosen/chosen.jquery.min.js');
$this->addCssFile($this->config->get('URL') . 'src/javascript/chosen/bootstrap-chosen.css');
$this->addScript('edit.js?20180524');
Method helpContent
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function helpContent()
{
return '<p>Batch types control what kind of change a batch makes and
may also be used for organization. Discount type controls the
batch type\'s behavior. You may have multiple batch types with
Method fetch_report_data
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method fetch_report_data
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$date1 = $this->form->date1;
Method fetch_report_data
has 53 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 post_handler
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_handler()
{
$brands = FormLib::get('brand');
$descriptions = FormLib::get('description');
$prices = FormLib::get('price');
Method getPlanSales
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPlanSales($weekID)
{
if ($weekID >= 374) {
$prep = $this->connection->prepare("select c.obfCategoryID, m.superID, b.storeID, b.planGoal
from " . FannieDB::fqn('ObfBudget', 'plugin:ObfDatabaseV2') . " AS b
Method get_illness_view
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_illness_view()
{
$this->illness = str_pad($this->illness, 4, '0', STR_PAD_LEFT);
$userP = $this->connection->prepare("SELECT name, real_name FROM " . FannieDB::fqn('Users', 'op') . " WHERE uid=?");
$user = $this->connection->getRow($userP, array($this->illness));