Showing 6,675 of 6,675 total issues
Method checkForMissingInput
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkForMissingInput() {
// Check for missing data
$missingFieldList = array();
// Check student ID
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var textDes = null;
var textLev = null;
var eButton = null;
var textName = <span className="text-muted"> {this.props.code} </span>;
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var options = this.props.locations;
var selectOptions = options.map(function(location){
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// Warning notification for invalid Banner size or Banner ID
var notification = <div className="alert alert-warning" role="alert">{this.state.errorWarning !== '' ? this.state.errorWarning: this.props.errorWarning}</div>
// Search bar for inputting the Banner ID
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var options = this.props.departments;
var selectOptions = options.map(function(department){
- Create a ticketCreate a ticket
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var name = null;
var hButton = null;
// Determines which element to show on the page (hide/show and Save/Edit)
if (this.props.hidden === 0) {
- Create a ticketCreate a ticket
Method getStudent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudent($studentId){
if($studentId === null || $studentId == ''){
throw new \InvalidArgumentException('Missing student ID.');
}
- Create a ticketCreate a ticket
Method buildSwiftMessage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function buildSwiftMessage($to, $fromAddress, $fromName, $subject, $content, $cc = NULL, $bcc = NULL){
// Sanity checking
if(!isset($to) || $to === null){
throw new \InvalidArgumentException('\"To\" not set.');
- Create a ticketCreate a ticket
Method homogenize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function homogenize(&$query)
{
$query_list = explode(',', $query);
$from[] = '/int\(\d+\)/iU';
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
constructor(props){
super(props);
this.state = {hasError: false};
this.handleDrop = this.handleDrop.bind(this);
- 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 56.
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
constructor(props){
super(props);
this.state = {hasError: false};
this.handleDrop = this.handleDrop.bind(this);
- 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 56.
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 render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="col-md-5 col-md-offset-1">
<br /><br /><br />
<div className="panel panel-default">
- Create a ticketCreate a ticket
Function searchListByDept
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchListByDept(e) {
var dept = null;
try {
// Saves the dept that the user is looking for.
- Create a ticketCreate a ticket
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="panel panel-default">
<div className="panel-body">
<div className="row">
- Create a ticketCreate a ticket
Function viewShowFilter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
viewShowFilter(data, filter) {
var filtered = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
- Create a ticketCreate a ticket
Method get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get()
{
$id = $_REQUEST['id'];
$type = $_REQUEST['type'];
// If the document's id is set then we're downloading the file
- Create a ticketCreate a ticket
Method getTotalRows
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTotalRows()
{
/**
* if total_column is set, use it to get total rows
*/
- Create a ticketCreate a ticket
Method buildMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildMessage()
{
$this->to = explode(',', $this->emailSettings->getExceptionEmail());
$this->subject = 'Uncaught Exception';
- Create a ticketCreate a ticket
Method getMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getMessage($id) {
if(is_null($id) || !isset($id)) {
throw new \InvalidArgumentException('Host ID is required.');
}
- Create a ticketCreate a ticket
Method addColumn
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
{
/****
* What is this for?
- Create a ticketCreate a ticket