Showing 2,136 of 2,138 total issues
Similar blocks of code found in 4 locations. Consider refactoring. Open
{ data.preview_url != null
? <a className="mb-edit" href={data.preview_url} title="Preview this activity" target="_blank" rel="noopener noreferrer">Preview</a>
: undefined }
- Read upRead up
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 59.
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
<tr>
<td colSpan={3} className={css.studentsTableRow}>
<StudentsTable classId={classInfo.id} currentSelectedProject={currentSelectedProject} />
</td>
</tr>
- Read upRead up
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 59.
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 (document.getElementById("pprfl")) {
document.getElementById("pprfl")?.addEventListener("scroll", this.handleLightboxScroll);
} else {
document.addEventListener("scroll", this.handlePageScroll);
}
- Read upRead up
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 59.
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
<a href={previewUrl} target="_blank" className={commonCss.smallButton} title="Preview" onClick={() => logEvent(previewLogData)} rel="noreferrer">Preview</a>
- Read upRead up
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 59.
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
<label>
<div>{ label }</div>
<input
type="date"
name={name}
- Read upRead up
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 59.
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 import_job_status
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_job_status(){
var targetUrl = "/import/imports/import_activity_progress";
var timer;
timer = setInterval(function(){
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(newDate) {
this.updateDaysRow();
this.date = newDate;
var today = new Date();
this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
Function Selector
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Prototype.Selector = (function() {
function select() {
throw new Error('Method "Prototype.Selector.select" must be defined.');
}
Function promise
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
Function html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
html: function( value ) {
return jQuery.access( this, function( value ) {
var elem = this[0] || {},
i = 0,
l = this.length;
Function expandcollapseoptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function expandcollapseoptions(id,material_type,btn_type){
if((material_type+id+btn_type)!=expandedShareButtonid)
{
$$(".Expand_Collapse").each(function(shareContainer){shareContainer.hide();shareContainer.removeClassName('visible');});
$$(".Expand_Collapse_Link").each(function(sharebtn){
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(newDate) {
this.updateDaysRow();
this.date = newDate;
var today = new Date();
this.headerSpan.innerHTML = UI.Calendar.Options.MONTHS[this.date.getMonth()] + ' ' + this.date.getFullYear();
Method get_notices_for_user
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.get_notices_for_user(user)
notices_hash = {
:notices => [],
:notice_display => '',
:notice_display_type => self.NOTICE_DISPLAY_TYPES[:no_notice]
Function updateDrag
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDrag: function(event, pointer) {
if(!this.dragging) this.startDrag(event);
if(!this.options.quiet){
Position.prepare();
Method login_line
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def login_line(options = {})
opts = {
:welcome => "Welcome",
:login => "Login",
:signup => "Sign up",
Method bulk_update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def bulk_update
class_id = params[:class_id]
student_ids = params[:student_ids]
add_permission_form_ids = params[:add_permission_form_ids] || []
remove_permission_form_ids = params[:remove_permission_form_ids] || []
Method create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
authorize Interactive
@interactive = Interactive.new(interactive_strong_params(params[:interactive]))
@interactive.user = current_visitor
Method update_class_and_teachers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_class_and_teachers(portal_clazz, object_params)
updated_class = portal_clazz.update(portal_clazz_strong_params(object_params))
if updated_class
class_name_changed = portal_clazz.saved_change_to_attribute?(:name)
Method security_question
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def security_question(number)
result = <<-EOF
<div class = 'f-row'>
<ui-select ng-model="regCtrl.questions[#{number}]"
name="questions[#{number}]" theme="select2"
Method down
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def down
create_table "resource_pages", :force => true do |t|
t.integer "user_id"
t.string "name"
t.text "description"