Showing 1,397 of 1,397 total issues
Function scanJSXEntity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function scanJSXEntity() {
var ch, str = '', start = index, count = 0, code;
ch = source[index];
assert(ch === '&', 'Entity must start with an ampersand');
index++;
- Create a ticketCreate a ticket
Method show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$tpl = array();
$now = time();
- Create a ticketCreate a ticket
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context){
$options = array(
ASSIGN_ADMIN => 'Administrative',
ASSIGN_LOTTERY => 'Lottery',
ASSIGN_FR => 'Freshmen',
- Create a ticketCreate a ticket
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
$id = $context->get('roommateId');
if(is_null($id)) {
throw new \InvalidArgumentException('Must set roommateId');
- Create a ticketCreate a ticket
Method show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$tpl = array();
$tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
- Create a ticketCreate a ticket
Function visitArrowFunction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function visitArrowFunction(traverse, node, path, state) {
var notInExpression = (path[0].type === Syntax.ExpressionStatement);
// Wrap a function into a grouping operator, if it's not
// in the expression position.
- Create a ticketCreate a ticket
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context){
if(!\Current_User::allow('hms', 'edit_role_members')){
throw new PermissionException('You do not have permission to edit role members.');
}
- Create a ticketCreate a ticket
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
// Check permissions
if(UserStatus::isAdmin()){
- Create a ticketCreate a ticket
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
$id = $context->get('roommateId');
if(is_null($id)) {
throw new \InvalidArgumentException('Must set roommateId');
- Create a ticketCreate a ticket
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
$options = array();
$options['assignment_type'] = array(
- Create a ticketCreate a ticket
Method formatException
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatException(\Exception $e)
{
ob_start();
echo "Ohes Noes! HMS threw an exception that was not caught!\n\n";
echo "Host: {$_SERVER['SERVER_NAME']}({$_SERVER['SERVER_ADDR']})\n";
- Create a ticketCreate a ticket
Method countInvitesByClassGender
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function countInvitesByClassGender($term, $class, $gender = null)
{
$query = "SELECT count(*) FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id
WHERE hms_lottery_application.invited_on IS NOT NULL
AND hms_new_application.term = $term ";
- Create a ticketCreate a ticket
Method save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function save(RoomDamageResponsibility $resp)
{
$db = PdoFactory::getPdoInstance();
$id = $resp->getId();
- Create a ticketCreate a ticket
Method show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(){
$tpl = array();
$tpl['TITLE'] = 'Edit Move-in Times';
- Create a ticketCreate a ticket
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($sendMagicWinners, $sendReminders, Array $inviteCounts)
{
// Gender and classes
$this->genders = array(
- Create a ticketCreate a ticket
Method increment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function increment()
{
if($this->bedtime < 2) {
$this->bedtime = 2;
- Create a ticketCreate a ticket
Method sendRoomChangeParticipantNotice
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function sendRoomChangeParticipantNotice(RoomChangeParticipant $requestor, RoomChangeParticipant $requestee)
{
$subject = 'Room Change Requested';
$template = 'email/roomChangeParticipantNotice.tpl';
$term = Term::getCurrentTerm();
- Create a ticketCreate a ticket
Method canLiveTogetherAdmin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function canLiveTogetherAdmin(Student $roommate1, Student $roommate2, $term)
{
// Sanity Checking
if (is_null($roommate1)) {
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
if(isset($user['rlc_second_choice_id'])) {
$db = new PHPWS_DB('hms_learning_communities');
$db->addColumn('community_name');
$db->addWhere('id', $user['rlc_second_choice_id']);
$result = $db->select('one');
- 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 102.
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(isset($user['rlc_third_choice_id'])) {
$db = new PHPWS_DB('hms_learning_communities');
$db->addColumn('community_name');
$db->addWhere('id', $user['rlc_third_choice_id']);
$result = $db->select('one');
- 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 102.
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