Showing 76 of 76 total issues
File swift-box.js
has 1379 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* SwiftBox
* A lightweight combobox plugin for jQuery
* https://github.com/Knotix/SwiftBox/
*
Function owlTableService
has 384 lines of code (exceeds 25 allowed). Consider refactoring. Open
function owlTableService ($http, $rootScope, $filter, $modal, owlConstants, owlResource, owlUtils, owlFilter) {
var unrenderedTable;
var service = {
tables: [],
Function render
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
var props = this.props;
var td;
var content;
var optionText;
- 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 owlFilter
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
function owlFilter (owlConstants, owlUtils) {
return {
hasNoFilters: function (columns) {
return _.every(columns, function (column) {
Function render
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var self = this;
var props = self.props;
var tackyTop = false;
File owlTableService.js
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (angular, _, $, React, OwlTableReact) {
'use strict';
function owlTableService ($http, $rootScope, $filter, $modal, owlConstants, owlResource, owlUtils, owlFilter) {
var unrenderedTable;
Function owlTableDirective
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
function owlTableDirective ($timeout, $window, owlTable) {
return {
restrict: 'EA',
scope: {
data: '=',
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var props = this.props;
var td;
var content;
var optionText;
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (self.props.column.type === 'date') {
$(self.getDOMNode()).on('changeDate', function (date) {
date.target.value = date.format().toUpperCase();
self.props.tableDidChange(date, self.props.row, self.props.column);
self.transmitSaveEvent(date);
- 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 125.
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 (self.props.column.type === 'date') {
$(self.getDOMNode()).on('changeData', function (date) {
date.target.value = date.format().toUpperCase();
self.props.tableDidChange(date, self.props.row, self.props.column);
self.transmitSaveEvent(date);
- 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 125.
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 compile
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function (tElem, tAttrs) {
return function link (scope, elem, attrs) {
var table;
var rendered;
Function link
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function link (scope, elem, attrs) {
var table;
var rendered;
var container = elem.find('.owl-react-container')[0];
File table.js
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
function stripFilters (string) {
_.forOwn(filterOptions, function (val, key) {
var keyRegExp = new RegExp('^' + key);
string = string.replace(keyRegExp, '');
});
Function render
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var props = this.props;
var input;
var options = props.column.options;
Similar blocks of code found in 2 locations. Consider refactoring. Open
(function (angular) {
'use strict';
function owlFilterControls (owlTable) {
return {
- 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 102.
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
(function (angular) {
'use strict';
function owlPagination (owlTable) {
return {
- 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 102.
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 setSelectedIndexes
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setSelectedIndexes(elements, indexes, trigger_change) {
elements = normalizeElementArray(elements);
if(indexes === undefined || indexes === null) {
indexes = [];
Function swiftsearch
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function swiftsearch(needle, haystacks, include_non_matches, result_limit) {
haystacks = haystacks || [];
needle = String(needle || '');
if(!(haystacks instanceof Array)) {
Function exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
// Use ENV vars on Travis and sauce.json locally to get credentials
if (!process.env.SAUCE_USERNAME) {
if (!fs.existsSync('sauce.json')) {
Function normalizeOptionArray
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function normalizeOptionArray(option_array, sort_function, remove_duplicates) {
if(option_array === undefined || option_array === null) {
option_array = [];
}