Showing 75 of 1,556 total issues
Function collapsibleTable
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
collapsibleTable: function() {
var $collapsible = $('.collapsible');
var $toggle = $('.collapsible-toggle');
// If there's only one table, don't bother with collapsing everything
Function initMarkdown
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initMarkdown: function () {
var inlineAttachmentConfig = {
uploadUrl: '/admin/html_embedded_image',
uploadFieldName: 'image',
jsonFieldName: 'file',
Function _setupField
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupField: function($container, overriddenLabel, overriddenHelper) {
var _this = this;
if ($container.length) {
var $label = $container.find('label:first');
var $helperTextContainerEl = $container.find('h6');
Function anchorClickListener
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
anchorClickListener: function() {
var scroll_offset = parseInt( $('.content-header').css('height'), 10 );
/**
* Smoothly scroll to destination if it's a link to the current page
- 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 filterFormListeners
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filterFormListeners: function() {
var _this = this;
this.$filter_form
// update search param when form submits
Function sizeFixedHeader
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sizeFixedHeader: function() {
var $tables = $('.content table');
var header_height = $('.js-content-header').outerHeight();
if(FCH.large_down) {
Function searchListener
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
searchListener: function() {
var _this = this;
// shift, ctrl, alt, caps
var ignored_keycodes = [16, 17, 18, 20];
// left, up, right, down
Function initHTML
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initHTML: function () {
var $html_editors = $('.js-html-editor');
if(!$html_editors.length) {
return;
}
Function stickyTableHeader
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stickyTableHeader: function() {
var $sticky_tables = $('.content table:not(.stuck-table)');
// Add sticky psuedo tables after our main table to hold the fixed header
$sticky_tables.each(function() {
Function _submitManager
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_submitManager: function() {
var _this = this;
var payload = {
form_manager: {
form_manager_model_name: _this.$theForm.data('form-manager-model'),
Function moveSelection
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
moveSelection: function(keyCode) {
var $results = $('.js-search-results');
var $result_links = $('.js-search-results a');
var $current_link = $('.js-search-results a.-current');
var current_index = $.inArray($current_link[0], $result_links);
- 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 rowSorting
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
rowSorting: function() {
$('.js-sort-row').sortable({
items: 'tbody tr',
opacity: 0.8,
handle: ('.sortable-handle'),
Function filterSubmission
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filterSubmission: function() {
var _this = this;
_this.$filter_form
.on('submit', function() {
Method change
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def change
create_table(:fae_users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
Function _buildErrorLinks
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_buildErrorLinks: function ($scope) {
const $header = $('.js-content-header');
const headerHeight = $header[0].getBoundingClientRect().height;
if (typeof $scope === 'undefined') {
Function _drawElements
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileInputer.prototype._drawElements = function() {
this.$input = this.$el.find('input[type="file"]');
// position the input off screen
this.$input.css({
Function formValidate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formValidate: function ($scope) {
var _this = this;
if (typeof $scope === 'undefined') {
$scope = FCH.$document;
Function multiselectOrChosen
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
multiselectOrChosen: function() {
var _this = this;
var availableItemsStr = ' Available Items';
var addedItemsStr = ' Added Items';
Method filter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def filter(params)
# build conditions if specific params are present
conditions = {}
conditions[:user_id] = params['user'] if params['user'].present?
conditions[:changeable_type] = params['model'] if params['model'].present?
Function utilitySearch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
utilitySearch: function() {
var _this = this;
var $header = $('#js-main-header');
var timer;