Showing 8,683 of 8,684 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
while($w = $dbc->fetch_row($skuR)){
$result = array(
'sku' => $w['sku'],
'title' => $this->asciiFilter($w['brand']).' - '. $this->asciiFilter($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 142.
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' => $this->asciiFilter($w['brand']).' - '. $this->asciiFilter($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 142.
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 (CoreLocal::get("balance") < CoreLocal::get("memChargeTotal") && CoreLocal::get("memChargeTotal") > 0){
if (CoreLocal::get('msgrepeat') == 0){
CoreLocal::set("boxMsg",sprintf("<b>A/R Imbalance</b><br />
Total AR payments $%.2f exceeds AR balance %.2f<br />",
CoreLocal::get("memChargeTotal"),
- 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 142.
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 (CoreLocal::get("balance") < CoreLocal::get("memChargeTotal") && CoreLocal::get("memChargeTotal") > 0) {
if (CoreLocal::get('msgrepeat') == 0) {
CoreLocal::set("boxMsg",sprintf("<b>A/R Imbalance</b><br />
Total AR payments $%.2f exceeds AR balance %.2f<br />",
CoreLocal::get("memChargeTotal"),
- 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 142.
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
Method message
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function message($val, $ref, $reprint=False){
global $CORE_LOCAL;
if ($val == 0) {
Method omtr_ttl
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function omtr_ttl()
{
// Must have gotten member number before totaling.
if (CoreLocal::get("memberID") == "0") {
return MiscLib::baseURL()."gui-modules/memlist.php";
Method checkPassword
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function checkPassword($password)
{
$password = strtoupper($password);
$password = str_replace("'", "", $password);
$password = str_replace(",", "", $password);
Database
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Database
{
/***********************************************************************************************
Method run
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method get_id_view
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_view()
{
$idP = $this->connection->prepare('SELECT b.upc, p.department, p.brand, p.description
FROM batchList AS b
LEFT JOIN products AS p ON b.upc=p.upc AND p.store_id=?
Method get_view
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_view()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
Method post_u_handler
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_u_handler()
{
if (!is_array($this->u)) {
$this->u = array($this->u);
}
Method drawSingleKey
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawSingleKey($dbc, $id, $n)
{
$keySize = 15;
$pdf = new FPDF('P', 'mm', 'Letter');
Method post_id_print_handler
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_print_handler()
{
$pdf=new FPDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
Method get_view
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$settings = $this->config->get('PLUGIN_SETTINGS');
$dbc = $this->connection;
$dbc->selectDB('HoursTracking');
Method body_content
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function body_content(){
ob_start();
?>
<ul>
<li><a href="OverShortDayPage.php" target="_WholeByCashier">Whole Day O/S</a>
Method get_id_view
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_view()
{
$row = $this->getIncident($this->id);
$row['details'] = nl2br($row['details']);
$row['details'] = preg_replace('/#(\d+)/', '<a href="?id=$1">#$1</a>', $row['details']);
Method get_id_sendAs_handler
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_sendAs_handler()
{
if (!file_exists('exporters/'.$this->sendAs.'.php')) {
return $this->unknownRequestHandler();
}
Method process_file
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process_file($linedata, $indexes)
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method results_content
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function results_content()
{
global $FANNIE_OP_DB, $FANNIE_SERVER_DBMS;
$dbc = FannieDB::get($FANNIE_OP_DB);