Showing 6,675 of 6,675 total issues
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var fgClasses = classNames({
'form-group': true,
'has-error': this.state.hasError
});
- Create a ticketCreate a ticket
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var fgClasses = classNames({
'form-group': true,
'has-error': this.state.hasError
});
- Create a ticketCreate a ticket
Method showWarnings
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showWarnings() {
// Get state of documents or affiliation
$conAffil = DocumentRest::contractAffilationSelected($this->intern->getId());
// Show warning if no documents uploaded or affiliation agreement selected but workflow state suggests there should be
- Create a ticketCreate a ticket
Function onAdminCreate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
onAdminCreate(username, department)
{
//var displayName = '';
var displayData = this.state.displayData;
var dept = this.state.deptData;
- 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 getMajors
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getMajors($term): AcademicMajorList
{
if($term === null || $term == '') {
throw new \InvalidArgumentException('Missing term.');
}
- 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 buildMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function buildMessage()
{
$this->to = explode(',', $this->emailSettings->getBackgroundCheckEmail());
$host = $this->internship->getHost();
- 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 addToggleFunction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addToggleFunction($function, $toggle=2)
{
if (empty($function) || $toggle < 2) {
return false;
}
- 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 getTotalRows
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getTotalRows()
{
/**
* if total_column is set, use it to get total rows
*/
- 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 copyAddress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copyAddress(){
//copy from Host Details to Supervisor Info
function doCopySupervisor(){
$("#internship_supervisor_address").val($("#internship_host_address").text());
- Create a ticketCreate a ticket
Method joinResult
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function joinResult($source_column, $join_table, $join_column, $content_column, $new_name=null, $searchable=false)
{
// TODO: this will break if you have more than one db pager at a time
// TODO: make this a private member variable
static $join_match = null;
- Create a ticketCreate a ticket
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($id, $username, $firstName, $lastName, $phone, $fax, $streetAddress1, $streetAddress2, $city, $state, $zip)
- Create a ticketCreate a ticket
Function sortBy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
sortBy(unsorted, typeOfSort) {
var sorted = [];
switch(typeOfSort) {
case 'subA':
sorted = unsorted.sort(function (a, b) {
- Create a ticketCreate a ticket
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
let list
let DropZone = <div></div>
// If there is a file uploaded it shows the file, else it shows dropzone so you can upload one
if (this.state.currentFiles.length > 0) {
- Create a ticketCreate a ticket
Function handleSave
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSave() {
this.setState({editMode: false});
var newStype = ReactDOM.findDOMNode(this.refs.savedStype).value.trim();
var newDescr = ReactDOM.findDOMNode(this.refs.savedDescr).value.trim();
- Create a ticketCreate a ticket
Method execute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Load the existing internship using its ID
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
// Load the emergency contacts from the old internship
- Create a ticketCreate a ticket
Method execute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
/* Check if user should have access to folders */
if (!\Current_User::isLogged()) {
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
<select id="country" name="country" className="form-control">
{Object.keys(countries).map(function(key) {
return <option key={key} value={key}>{countries[key]}</option>;
})}
</select>
- 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 62.
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 3 locations. Consider refactoring. Open
<select id="department2" name="department" className="form-control" defaultValue="-1">
{Object.keys(departments).map(function(key) {
return <option key={key} value={key}>{departments[key]}</option>;
})}
</select>
- 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 62.
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 3 locations. Consider refactoring. Open
<select id="country" onChange={this.handleDrop} name="country" className="form-control">
{Object.keys(countries).map(function(key) {
return <option key={key} value={key}>{countries[key]}</option>;
})}
</select>
- 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 62.
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
constructor(props){
super(props);
this.handleChange = this.handleChange.bind(this);
this.onShowAffiliate = this.onShowAffiliate.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 62.
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