Showing 1,397 of 1,397 total issues
Function parsePrimaryExpression
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parsePrimaryExpression() {
var marker, type, token, expr;
type = lookahead.type;
- Create a ticketCreate a ticket
Method execute
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
$term = $context->get('term');
$student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
- Create a ticketCreate a ticket
Function execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
/*
if(!\Current_User::allow('hms', 'email_hall') && !\Current_User::allow('hms', 'email_all')){
throw new PermissionException('You do not have permission to send messages.');
- 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"
Further reading
Function can_change_gender
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function can_change_gender($target_gender, $ignore_upper = false)
{
// Ignore upper is true, we're trying to change a hall's gender
if($ignore_upper) {
// If ignore upper is true and the target gender is coed, then
- 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"
Further reading
Function execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$db = new \PHPWS_DB('hms_assignment');
$db->addColumn('hms_assignment.banner_id');
$db->addColumn('hms_assignment.reason');
$db->addColumn('hms_residence_hall.hall_name');
- 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"
Further reading
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
namespace Homestead\ApplicationFeature;
use \Homestead\ApplicationFeatureRegistration;
- 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 133.
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
<?php
namespace Homestead\ApplicationFeature;
use \Homestead\ApplicationFeatureRegistration;
- 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 133.
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 2
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../main":2,"./inline-source-map":41}],2:[function(_dereq_,module,exports){
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
- Create a ticketCreate a ticket
Method execute
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
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 execute
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context){
if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'roommate_maintenance')){
throw new PermissionException('You do not have permission to create/edit roommate groups.');
}
- Create a ticketCreate a ticket
Method execute
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'deadlines')) {
throw new PermissionException('You do not have permission to edit deadlines.');
}
- Create a ticketCreate a ticket
Function utf8ToBytes
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
- Create a ticketCreate a ticket
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
let sentDate = null;
let subject = null;
let opened = null;
- Create a ticketCreate a ticket
Method execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
session_write_close();
session_start();
- Create a ticketCreate a ticket
Function _renderClassBody
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _renderClassBody(traverse, node, path, state) {
var className = state.className;
var superClass = state.superClass;
// Set up prototype of constructor on same line as `extends` for line-number
- Create a ticketCreate a ticket
Method show
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$tpl = array();
if(!is_null($this->community)){
- Create a ticketCreate a ticket
Method execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$db = new \PHPWS_DB('hms_new_application');
$db->addColumn('hms_new_application.*');
$db->addWhere('term', $this->term);
$db->addWhere('cancelled', 0);
- Create a ticketCreate a ticket
Method execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$lotteryTerm = \PHPWS_Settings::get('hms', 'lottery_term');
/*******************************
- Create a ticketCreate a ticket
LotteryProcess
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class LotteryProcess {
private $sendMagicWinners;
private $sendReminders;
private $inviteCounts;
private $applicationsRemaining;
- Create a ticketCreate a ticket
RoomChangeRequest
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class RoomChangeRequest {
protected $id;
protected $term;
- Create a ticketCreate a ticket