Showing 628 of 628 total issues
Function formatNodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var formatNodes = function(nodes) {
var holder = $("<span>");
var ul = $("<ul>")
// Sort by prefLabel
Function bp_autocomplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.bp_autocomplete = function(url, options, data) {
// Make sure options exists
options = options || {};
// Set url as option
options.url = url;
Function formatNodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var formatNodes = function(nodes) {
var holder = $("<span>");
var ul = $("<ul>")
// Sort by prefLabel
Function formatNodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
TREE.formatNodes = function(nodes) {
var holder = $("<span>");
var ul = $("<ul>")
// Sort by prefLabel
Function serialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function serialize(object) {
var out;
if (angular.isElement(object)) {
object = angular.element(object);
Function closeAnimation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function closeAnimation() {
if (!closeAnimation.hasBeenRun) {
if (runner) { //the runner doesn't exist if it fails to instantiate
runner.applyStyles();
}
Function formatNodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var formatNodes = function(nodes) {
var holder = $("<span>");
var ul = $("<ul>")
// Sort by prefLabel
Function resolveElementClasses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveElementClasses(element, cache, runningAnimations) {
runningAnimations = runningAnimations || {};
var lookup = {};
forEach(runningAnimations, function(data, selector) {
Function get_class_details_from_raw
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_class_details_from_raw(cls) {
var
ont_acronym = cls.links.ontology.replace(/.*\//, ''),
ont_name = annotator_ontologies[cls.links.ontology].name,
ont_rel_ui = '/ontologies/' + ont_acronym,
Function get_class_details_from_raw
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_class_details_from_raw(cls) {
var
ont_acronym = cls.links.ontology.replace(/.*\//, ''),
ont_name = annotator_ontologies[cls.links.ontology].name,
ont_rel_ui = '/ontologies/' + ont_acronym,
Function bp_autocomplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.bp_autocomplete = function(url, options, data) {
// Make sure options exists
options = options || {};
// Set url as option
options.url = url;
Method simplify_class_model
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def simplify_class_model(cls_model)
# Simplify the class required required by the UI.
# No modification of the class ontology here, see simplify_classes.
# Default simple class model
cls = { :id => nil, :ontology => nil, :prefLabel => nil, :uri => nil, :ui => nil, :obsolete => false }
Function display_annotations
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_annotations(data, params) {
"use strict";
var annotations = data.annotations;
var all_rows = [];
if (params.raw !== undefined && params.raw === true) {
Method virtual_show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def virtual_show
note_id = params[:noteid]
concept_id = params[:conceptid]
ontology_acronym = params[:ontology]
Function performAnimation
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
Consider simplifying this complex logical expression. Open
} else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
typeof Components !== 'undefined' && Components.classes &&
Components.interfaces)) {
//Avert your gaze!
Cc = Components.classes,
Consider simplifying this complex logical expression. Open
if (value && value.length !== 0)
{
var v = angular.lowercase("" + value);
value = !(v === 'f' || v === '0' || v === 'false' || v === 'no' || v === 'n' || v === '[]');
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (data.notices) {
var notice = data.notices.replace(reg, ',');
notices.push.apply(notices, notice.split(","));
}
- 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 55.
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 (data.success) {
var suc = data.success.replace(reg, ',');
success.push.apply(success, suc.split(","));
}
- 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 55.
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
lunr.Vector = function () {
this._magnitude = null
this.list = undefined
this.length = 0
}
- 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 54.
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