Showing 8,683 of 8,684 total issues
File RpFloralPage.php
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
include(__DIR__ . '/../../../config.php');
if (!class_exists('FannieAPI')) {
include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
Method HandleDeviceMessage
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected override void HandleDeviceMessage(byte[] msg)
{
if (this.verbose_mode > 0)
System.Console.Write("DMSG: {0}: ",current_state);
EditBatchPage
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class EditBatchPage extends FannieRESTfulPage
{
protected $must_authenticate = true;
protected $auth_classes = array('batches','batches_audited');
protected $title = 'Sales Batches Tool';
FannieSignage
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class FannieSignage
{
protected $items = array();
protected $source = '';
protected $source_id = 0;
Class DefaultContractResolver
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
public class DefaultContractResolver : IContractResolver
{
private static readonly IContractResolver _instance = new DefaultContractResolver(true);
internal static IContractResolver Instance
Class ReflectionUtils
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
internal static class ReflectionUtils
{
public static readonly Type[] EmptyTypes;
static ReflectionUtils()
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function materializeValue()
{
$value = $this->param_value();
if ($this->is_array()) {
if ($value === '') {
- 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 200.
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
public function materializeValue()
{
$value = $this->param_value();
if ($this->is_array()) {
if ($value === '') {
- 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 200.
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 FanniePage.php
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2012 Whole Foods Co-op
Function scanner
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
var scanner = (function ($) {
var mod = {};
var lastSearch = 0;
Method javascript_content
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function javascript_content()
{
return <<<JAVASCRIPT
var uniqTable = document.getElementById('uniq-table');
var currentRow = 2;
Method fetch_report_data
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('OP_DB'));
$data = array();
File ViewPickups.php
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use COREPOS\Fannie\API\lib\Store;
include(__DIR__ . '/../../../config.php');
File WebSocketServer.cs
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Net;
using System.Net.Sockets;
using System.Collections.Generic;
using System.Threading;
Identical blocks of code found in 2 locations. Consider refactoring. Open
protected string GetSignature(bool udp=true)
{
string xml="<?xml version=\"1.0\"?>"
+ "<TStream>"
+ "<Transaction>"
- 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 376.
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
protected string GetSignature(bool udp=true)
{
string xml="<?xml version=\"1.0\"?>"
+ "<TStream>"
+ "<Transaction>"
- 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 376.
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 doc
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doc()
{
return '
Use:
This is IT CORE\'s transaction log. A rather important table.
Function get
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
static public function get($session){
$DESIRED_TENDERS = array("CK"=>"CHECK TENDERS",
"CC"=>"CREDIT CARD TENDERS",
"CA"=>"CASH TENDERS",
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function sort
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function sort(array $rowset)
{
$tax = false;
$discount = false;
$total = false;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fetch_report_data
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function fetch_report_data()
{
$date_id = date('Ymd', strtotime(FormLib::get('date', date('Y-m-d'))));
$date_str = date('Y-m-d', strtotime(FormLib::get('date', date('Y-m-d'))));
$store = FormLib::get('store', false);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"