Showing 8,683 of 8,684 total issues
Method preprocess
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocess(){
global $FANNIE_OP_DB,$FANNIE_PLUGIN_SETTINGS;
$ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
if (isset($_GET['submitted'])) { // If the form has been submitted.
// Validate the data.
Method post_id_handler
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_id_handler()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$ret = array('error' => false);
Method finishForce
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function finishForce($id, $updateType, $has_limit=true)
{
$columnsP = $this->connection->prepare('
SELECT p.upc,
p.normal_price,
FannieReportPage
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class FannieReportPage extends FanniePage
{
public $required = True;
Class JTokenWriter
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
public class JTokenWriter : JsonWriter
{
private JContainer _token;
private JContainer _parent;
// used when writer is writing single value and the value has no containing parent
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($maxes['bacon'] > 0) {
$this->connection->startTransaction();
$upP = $this->connection->prepare("UPDATE {$mydb}MyStats SET stat=? WHERE myStatID=?");
$res = $this->connection->query("SELECT myStatID, stat FROM {$mydb}MyStats WHERE statID=3");
while ($row = $this->connection->fetchRow($res)) {
- 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 176.
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
public function calculate_footers($data)
{
if (count($data) == 0) {
return array();
}
- 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 176.
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 ($maxes['coffee'] > 0) {
$this->connection->startTransaction();
$upP = $this->connection->prepare("UPDATE {$mydb}MyStats SET stat=? WHERE myStatID=?");
$res = $this->connection->query("SELECT myStatID, stat FROM {$mydb}MyStats WHERE statID=2");
while ($row = $this->connection->fetchRow($res)) {
- 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 176.
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
public function calculate_footers($data)
{
if (count($data) == 0) {
return array();
}
- 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 176.
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 prepareDataCapVoid
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareDataCapVoid($pcID)
{
$dbc = Database::tDataConnect();
$prep = $dbc->prepare('SELECT transNo, registerNo FROM PaycardTransactions WHERE paycardTransactionID=?');
$row = $dbc->getRow($prep, $pcID);
Method renderAsHTML
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderAsHTML()
{
$ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
$ret .= '<tr>';
Method post_id_upc_terms_handler
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post_id_upc_terms_handler()
{
$this->id = preg_split('/[^\d]/', $this->id, 0, PREG_SPLIT_NO_EMPTY);
$pdf = new FPDF('P', 'mm', 'Letter');
Method renderAsHTML
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderAsHTML()
{
$ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
$ret .= '<tr>';
Method renderAsHTML
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderAsHTML()
{
$ret = '<table style="border: 1px solid black; border-collapse: collapse;">';
$ret .= '<tr>';
File RenderReceiptPage.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
include(dirname(__FILE__) . '/../../config.php');
if (!class_exists('FannieAPI')) {
include_once(__DIR__ . '/../../classlib2.0/FannieAPI.php');
}
File LikeCodeModule.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2013 Whole Foods Co-op, Duluth, MN
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function changeCosts($changes)
{
$actual = array();
$prodP = $this->connection->prepare("SELECT cost FROM products WHERE upc=?");
$lcP = $this->connection->prepare("SELECT upc FROM upcLike WHERE likeCode=?");
- 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 175.
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
public function changeCosts($changes)
{
$actual = array();
$prodP = $this->connection->prepare("SELECT cost FROM products WHERE upc=?");
$lcP = $this->connection->prepare("SELECT upc FROM upcLike WHERE likeCode=?");
- 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 175.
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 buildLTTViewsGeneric
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildLTTViewsGeneric($db, $type, $errors=array())
{
//--------------------------------------------------------------
// CREATE lttSummary VIEW
//--------------------------------------------------------------
Method fetch_report_data
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));