Showing 2,136 of 2,138 total issues
Consider simplifying this complex logical expression. Open
if ((!(this.tinymceOptions.theme_advanced_buttons1 && this.tinymceOptions.theme_advanced_buttons1.match(/(^|,)save(,|$)/)) &&
!(this.tinymceOptions.theme_advanced_buttons2 && this.tinymceOptions.theme_advanced_buttons2.match(/(^|,)save(,|$)/)) &&
!(this.tinymceOptions.theme_advanced_buttons3 && this.tinymceOptions.theme_advanced_buttons3.match(/(^|,)save(,|$)/))) ||
(this.tinymceOptions.plugins == undefined || !this.tinymceOptions.plugins.match(/(^|,)save(,|$)/))) {
throw("InPlaceRichEditor' tinymceSave option require at least the save button and the save plugin in tinyMCE initialization.");
Consider simplifying this complex logical expression. Open
elsif researcher_view && class_researcher?
true
else
class_student? &&
record &&
Function draw
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function() {
var el = this.targetElement,
props = this.styleInfos.borderInfo.getProps(),
bounds = this.boundsInfo.getBounds(),
w = bounds.w,
Function clone
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var srcElements,
destElements,
i,
clone;
Function offset
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
Function add
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(newLocation, historyData) {
var that = this;
/*Escape the location and remove any leading hash symbols*/
Function onKeyPress
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
onKeyPress: function(event) {
if(this.active)
switch(event.keyCode) {
case Event.KEY_TAB:
case Event.KEY_RETURN:
Function constructCanvas
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructCanvas: function(){
var el = this.el,
size, c, oc;
// The old canvases are retrieved to avoid memory leaks ...
Function constructCanvas
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructCanvas: function(){
var el = this.el,
size, c, oc;
// The old canvases are retrieved to avoid memory leaks ...
Method initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(offering, protocol, host_with_port, current_user, additional_external_report_id, anonymize_students = false)
runnable = offering.runnable
self.id = offering.id
self.teacher = offering.clazz.teacher.name
self.clazz = offering.clazz.name
Function draw
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function(event) {
var pointer = [Event.pointerX(event), Event.pointerY(event)];
var style = this.element.style;
if (this.currentDirection.indexOf('n') != -1) {
var pointerMoved = this.startY - pointer[1];
Method to_sc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_sc
str = ''
if @scheme
str << @scheme
str << ':'
Method resolve
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resolve
if user.has_role?('manager','admin','researcher')
all
elsif user.is_project_admin? || user.is_project_researcher?
where = []
Function renderInput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderInput (name: any, titleOverride?: any) {
if (!this.state.filterables[name]) { return; }
const hits = this.state.filterables[name];
Function search
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
search (query: any) {
const setSuggestions = (suggestions: any, callback?: any) => {
const showSuggestions = suggestions.length > 0;
this.setState({ suggestions, selectedSuggestionIndex: -1, showSuggestions }, callback);
};
Function apiCall
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
apiCall (action: any, options: any) {
const basePath = "/api/v1/bookmarks";
const { onSuccess } = options;
let { bookmark, data } = options;
Similar blocks of code found in 2 locations. Consider refactoring. Open
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
- 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 61.
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 ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
- 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 61.
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 ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
- 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 61.
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
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
- 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 61.
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