Showing 628 of 628 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
lunr.TokenStore.load = function (serialisedData) {
var store = new this
store.root = serialisedData.root
store.length = serialisedData.length
- 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 68.
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 buildResults
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildResults(resultObjects, filterTxt) {
filterTxt = '(' + filterTxt + ')';
var bOddRow = true, i, iFound = 0,
filterPatt = settings.caseSensitive ? new RegExp(filterTxt, 'g') : new RegExp(filterTxt, 'ig');
Function SearchAnalytics
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function SearchAnalytics() {
this.bindTracker = function() {
jQuery(document).on("click", "#search_results_container div.class_link a", function(e) {
e.preventDefault();
- Read upRead up
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 bp_internal_formComplete_formatItem
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bp_internal_formComplete_formatItem(row) {
var input = this.extraParams.input;
var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); // .*+?|()[]{}\
var keywords = jQuery(input).val().replace(specials, "\\$&").split(' ').join('|');
var regex = new RegExp( '(' + keywords + ')', 'gi' );
Function SearchAnalytics
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SearchAnalytics() {
this.bindTracker = function() {
jQuery(document).on("click", "#search_results_container div.class_link a", function(e) {
e.preventDefault();
Identical blocks of code found in 2 locations. Consider refactoring. Open
lunr.Pipeline.prototype.toJSON = function () {
return this._stack.map(function (fn) {
lunr.Pipeline.warnIfFunctionNotRegistered(fn)
return fn.label
- 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 66.
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
lunr.Store.prototype.remove = function (id) {
if (!this.has(id)) return
delete this.store[id]
this.length--
- 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 66.
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
lunr.Store.prototype.remove = function (id) {
if (!this.has(id)) return
delete this.store[id]
this.length--
- 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 66.
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
lunr.Pipeline.prototype.toJSON = function () {
return this._stack.map(function (fn) {
lunr.Pipeline.warnIfFunctionNotRegistered(fn)
return fn.label
- 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 66.
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 run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function run(fns, cancellations, allCompleteFn) {
var animations = [];
forEach(fns, function(animation) {
animation.fn && animations.push(animation);
});
Function setAjaxNodes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
if (typeof OPTIONS.beforeExpand == 'function') {
OPTIONS.beforeExpand(node);
}
$TREE_CONTAINER.trigger("beforeExpand", node);
Function setAjaxNodes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
if (typeof OPTIONS.beforeExpand == 'function') {
OPTIONS.beforeExpand(node);
}
$TREE_CONTAINER.trigger("beforeExpand", node);
Function setAjaxNodes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
TREE.setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
if (typeof OPTIONS.beforeExpand == 'function') {
OPTIONS.beforeExpand(node);
}
$TREE_CONTAINER.trigger("beforeExpand", node);
Function setAjaxNodes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
if (typeof OPTIONS.beforeExpand == 'function') {
OPTIONS.beforeExpand(node);
}
$TREE_CONTAINER.trigger("beforeExpand", node);
Method get_annotated_classes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_annotated_classes(annotations, semantic_types=[])
# Use batch service to get class prefLabels
class_list = []
annotations.each {|a| class_list << get_annotated_class_hash(a) }
hierarchy = annotations.map {|a| a if a.keys.include? 'hierarchy' }.compact
Function ajax_process_ont
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ajax_process_ont = function() {
if( ajax_ont_array.length === 0 ){
ajax_process_ont_halt();
return true;
}
Method get_annotated_classes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_annotated_classes(annotations, semantic_types=[])
# Use batch service to get class prefLabels
class_list = []
annotations.each {|a| class_list << get_annotated_class_hash(a) }
hierarchy = annotations.map {|a| a if a.keys.include? 'hierarchy' }.compact
Function compile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function (tElement, tAttrs, transclude)
{
return function (scope, elm, attrs, controllers)
{
var bindonceController = controllers[0];
Function $get
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = function() {
var $log = {
log: function() { $log.log.logs.push(concat([], arguments, 0)); },
warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },
info: function() { $log.info.logs.push(concat([], arguments, 0)); },
Function get_annotation_rows_from_raw
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_annotation_rows_from_raw(annotation, params) {
"use strict";
// data independent var declarations
var
rows = [],