Showing 64 of 163 total issues
Function resize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
resize : function () {
var self = this;
self.S('[' + this.attr_name() + ']').each(function () {
var topbar = self.S(this),
settings = topbar.data(self.attr_name(true) + '-init');
Function events
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
events : function () {
var self = this,
S = self.S,
settings = self.settings;
Function init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
init : function (section, method, options) {
Foundation.inherit(this, 'add_custom_rule register_media throttle');
var self = this;
self.register_media('topbar', 'foundation-mq-topbar');
Function build_markup
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.build_markup = function() {
slides_container.wrap('<div class="'+settings.container_class+'"></div>');
container = slides_container.parent();
slides_container.addClass(settings.slides_container_class);
Function shift
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
shift : function (current, target, callback) {
var clearing = target.parent(),
old_index = this.settings.prev_index || target.index(),
direction = this.direction(clearing, current, target),
dir = this.rtl ? 'right' : 'left',
Function pos_phone
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
pos_phone : function (init) {
var tip_height = this.settings.$next_tip.outerHeight(),
tip_offset = this.settings.$next_tip.offset(),
target_height = this.settings.$target.outerHeight(),
$nub = $('.joyride-nub', this.settings.$next_tip),
Function center_and_label
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
center_and_label : function (target, label) {
if (!this.rtl) {
target.css({
marginLeft : -(target.outerWidth() / 2),
marginTop : -(target.outerHeight() / 2)
Function equalize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
equalize: function(equalizer) {
var isStacked = false,
vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'),
settings = equalizer.data(this.attr_name(true)+'-init');
Function set_ui
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
set_ui : function($handle, value) {
var settings = $.data($handle[0], 'settings'),
handle_l = $.data($handle[0], 'handle_l'),
bar_l = $.data($handle[0], 'bar_l'),
norm_pct = this.normalized_percentage(value, settings.start, settings.end),
Function assemble
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
assemble : function (topbar) {
var self = this,
settings = topbar.data(this.attr_name(true) + '-init'),
section = self.S('section', topbar);
Function events
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
events : function (scope) {
var self = this,
form = self.S(scope).attr('novalidate', 'novalidate'),
settings = form.data(this.attr_name(true) + '-init') || {};
Consider simplifying this complex logical expression. Open
if ($.data(self.cache.active[0], 'settings').vertical) {
var scroll_offset = 0;
if (!e.pageY) {
scroll_offset = window.scrollY;
}
Function get_formatters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_formatters():
fs = []
for f in s.INSTALLED_APPS:
try:
f_module = __import__(f, fromlist=['setting_formatters']).setting_formatters
- 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 app
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
.controller("SkillListCtrl", ['$scope', '$window', function($scope, $window) {
var skillList = this;
skillList.filter = function () {
var skillList = this;
- 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
Avoid deeply nested control flow statements. Open
if (self.S(klass).hasClass('fixed')) {
self.S(klass).removeClass('fixed');
self.S('body').removeClass('f-topbar-fixed');
}
Avoid deeply nested control flow statements. Open
if (this.settings.timer > 0) {
this.settings.$next_tip
.fadeIn(this.settings.tip_animation_fade_speed)
.show();
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
init : function (scope, libraries, method, options, response) {
Function get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(self, request):
context = self.get_context()
context['format'] = request.GET.get('format')
if request.GET.get('q'):
validator = self.validators.get(request.GET.get('format'))
- 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
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return false;