Showing 76 of 76 total issues
Function componentDidMount
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount: function () {
var self = this;
var filterList = document.createElement('div');
filterList.className = 'owl-filter-list';
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
var props = this.props;
var input;
var options = props.column.options;
- 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 swiftbox
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function swiftbox(elements, config) {
elements = normalizeElementArray(elements);
var new_elements = [];
Function owlPrintDirective
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function owlPrintDirective($window, owlTable, $timeout) {
var printSection = document.getElementById('owlPrintSection');
if (!printSection) {
printSection = document.createElement('div');
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
var self = this;
var props = self.props;
var tackyTop = false;
- 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
Similar blocks of code found in 3 locations. Consider refactoring. Open
for(var j = 0; j < new_indexes.length; ++j) {
var index = new_indexes[j];
var option = option_array[index];
if(option) {
- 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 71.
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
for(var i = 0; i < selected_indexes.length; ++i) {
var index = selected_indexes[i];
var option = option_array[index];
if(option) {
- 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 71.
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
for(var i = 0; i < selected_indexes.length; ++i) {
var index = selected_indexes[i];
var option = option_array[index];
if(option) {
- 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 71.
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 filterCell
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
filterCell: function (row, column, termCache, i, filter) {
var conditionType = typeof filter.condition;
if (conditionType === 'undefined' || !conditionType) {
filter.condition = owlConstants.filtering.CONTAINS;
}
Function owlExportControls
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function owlExportControls (owlTable) {
return {
restrict: 'EA',
require: '^owlTable',
templateUrl: 'partials/export.html',
Function link
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link (scope, elem, attrs, tableCtrl) {
elem.on('click', function () {
elem.tooltip({
title: 'Please wait...',
trigger: 'manual',
Function positionOptions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function positionOptions() {
var bounding_rectangle = active_select.getBoundingClientRect();
var window_width = window.innerWidth;
var window_height = window.innerHeight;
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var props = this.props;
var state = this.state;
var handler = this.clickHandler;
Function showOptions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showOptions(element) {
element = normalizeElementArray(element)[0];
// If the element is already active, we're done
if(active_select === element) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
for(var i = 0; i < elements.length; ++i) {
var element = elements[i];
var container_element = getElementCache(element).container;
container_element.tabIndex = tab_index;
- 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 64.
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
for(var i = 0; i < elements.length; ++i) {
var element = elements[i];
var text_element = getElementCache(element).text;
text_element[textContent] = text;
- 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 64.
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 calculateWidth
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calculateWidth(element, option_array) {
element = normalizeElementArray(element)[0];
if(!element || !option_array || !option_array.length) {
return 0;
Function sortSearchResults
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sortSearchResults(a, b) {
var tmp_a;
var tmp_b;
tmp_a = -a.longest_match;
Function initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
service.initialize = function (settings) {
//this.data = settings.data;
this.columns = settings.columns;
this.childColumns = settings.childColumns;
this.options = _.defaults(settings.options, defaults.options);
Function filterTable
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
filterTable: function (rows, columns) {
var self = this;
if (!rows) {
return;