Showing 54 of 76 total issues
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
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
Function filterCell
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
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
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
Open
function showOptions(element) {
element = normalizeElementArray(element)[0];
// If the element is already active, we're done
if(active_select === element) {
Function calculateWidth
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Open
filterTable: function (rows, columns) {
var self = this;
if (!rows) {
return;
Function owlSpinner
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function owlSpinner(owlTable) {
function link (scope, elem, attrs, tableCtrl) {
var opts = {
lines: 13, // The number of lines to draw
length: 20, // The length of each line
Function owlResource
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function owlResource ($http, owlUtils) {
return function (options) {
var saveUrl = '';
Function initializeTacky
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initializeTacky() {
// Initialize the jQuery plugin
if($) {
$.fn.tacky = function() {
return tacky(this);
Function setValues
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setValues(elements, values, trigger_change) {
elements = normalizeElementArray(elements);
if(!(values instanceof Array)) {
values = [values];
Function customizeColumns
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
service.customizeColumns = function () {
var self = this;
var modal = $modal.open({
templateUrl: 'partials/columnModal.html',
Function selectAll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function selectAll(elements, filtered) {
elements = normalizeElementArray(elements);
for(var i = 0; i < elements.length; ++i) {
var element = elements[i];
Function controller
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ['$scope', function ($scope) {
this.csvHeader = function () {
return $scope.columns.map(function (column) {
return column.title;
});
Function renderOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderOptions(scroll_top) {
// Hide all options initially
$option_elements.addClass('swift-box-hidden');
// If there are no options, we're done
Function filterOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function filterOptions(filter_text) {
// Normalize the filter text
if(filter_text === undefined || filter_text === null) {
filter_text = '';
}