Showing 1,397 of 1,397 total issues
Method show
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$tpl = array();
$tpl['COMMUNITY_NAME'] = $this->rlcAssignment->getRlcName();
- Create a ticketCreate a ticket
Method show
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$tpl = array();
$submitCmd = CommandFactory::getCommand('LotteryConfirm');
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (matchKeyword('extends')) {
expectKeyword('extends');
previousYieldAllowed = state.yieldAllowed;
state.yieldAllowed = false;
superClass = parseLeftHandSideExpressionAllowCall();
- Read upRead up
- Create a ticketCreate a ticket
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 82.
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
if (matchKeyword('extends')) {
expectKeyword('extends');
previousYieldAllowed = state.yieldAllowed;
state.yieldAllowed = false;
superClass = parseLeftHandSideExpressionAllowCall();
- Read upRead up
- Create a ticketCreate a ticket
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 82.
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 execute()
{
$this->lastTerm = Term::getPreviousYear($this->term);
$thisTermDate = $this->getCumulativeCountsByTerm($this->term);
- Read upRead up
- Create a ticketCreate a ticket
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 128.
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 execute()
{
$this->lastTerm = Term::getPreviousYear($this->term);
$thisTermDate = $this->getCumulativeCountsByTerm($this->term);
- Read upRead up
- Create a ticketCreate a ticket
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 128.
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
Consider simplifying this complex logical expression. Open
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
&& aGenerated.line > 0 && aGenerated.column >= 0
&& aOriginal.line > 0 && aOriginal.column >= 0
&& aSource) {
- Create a ticketCreate a ticket
CommandContext
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CommandContext {
private $params = array();
private $error = "";
private $content = "";
- Create a ticketCreate a ticket
SOAP
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class SOAP
{
// User types
const ADMIN_USER = 'A';
- Create a ticketCreate a ticket
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
var profileLink = "index.php?module=hms&action=ShowStudentProfile&username=" + this.props.node.username;
var applicationLink = "index.php?module=hms&action=ShowRlcApplicationReView&appId=" + this.props.node.applicationId;
var success = false;
var danger = false;
- Create a ticketCreate a ticket
Function visitCallSpread
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function visitCallSpread(traverse, node, path, state) {
utils.catchup(node.range[0], state);
if (node.type === Syntax.NewExpression) {
// Input = new Set(1, 2, ...list)
- Create a ticketCreate a ticket
Method execute
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
if(!\Current_User::allow('hms', 'view_rlc_members')){
throw new PermissionException('You do not have permission to view RLC members.');
}
- Create a ticketCreate a ticket
Method show
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'edit_terms')) {
throw new PermissionException('You do not have permission to edit terms.');
}
- Create a ticketCreate a ticket
File HMS_RLC_Assignment.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Homestead;
use \Homestead\Exception\PermissionException;
- Create a ticketCreate a ticket
Function 13
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"./util":19,"amdefine":20}],13:[function(_dereq_,module,exports){
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
- Create a ticketCreate a ticket
Function 33
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"esprima-fb":9}],33:[function(_dereq_,module,exports){
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*/
/*global exports:true*/
- Create a ticketCreate a ticket
Method plugSOAPData
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function plugSOAPData(&$student, $soapData)
{
$student->setBannerId($soapData->banner_id);
$student->setUsername($soapData->user_name);
- Create a ticketCreate a ticket
Method process
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function process($arguments)
{
$dump_data = false;
$term = get_term_default();
- Create a ticketCreate a ticket
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
if (!isset($this->term) || is_null($this->term)) {
throw new \InvalidArgumentException('Missing term.');
}
- Create a ticketCreate a ticket
Function execute
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context) {
if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'banner_queue')){
throw new PermissionException('You do not have permission to enable/disable the Banner queue.');
}
- Read upRead up
- Create a ticketCreate a ticket
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"