Showing 54 of 76 total issues
File swift-box.js
has 1379 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
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
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
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
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
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
Open
function owlTableDirective ($timeout, $window, owlTable) {
return {
restrict: 'EA',
scope: {
data: '=',
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var props = this.props;
var td;
var content;
var optionText;
Function compile
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Open
render: function () {
var props = this.props;
var input;
var options = props.column.options;
Function setSelectedIndexes
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Open
function normalizeOptionArray(option_array, sort_function, remove_duplicates) {
if(option_array === undefined || option_array === null) {
option_array = [];
}
Function componentDidMount
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
Open
function swiftbox(elements, config) {
elements = normalizeElementArray(elements);
var new_elements = [];
Function owlPrintDirective
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function owlPrintDirective($window, owlTable, $timeout) {
var printSection = document.getElementById('owlPrintSection');
if (!printSection) {
printSection = document.createElement('div');