Showing 96 of 196 total issues
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if ( typeof newPayload === "string"
|| newPayload instanceof ArrayBuffer
|| newPayload instanceof Int8Array
|| newPayload instanceof Uint8Array
|| newPayload instanceof Int16Array
- Create a ticketCreate a ticket
Function slide
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
- Create a ticketCreate a ticket
Function _disconnected
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ClientImpl.prototype._disconnected = function (errorCode, errorText) {
this._trace("Client._disconnected", errorCode, errorText);
this.sendPinger.cancel();
this.receivePinger.cancel();
- Create a ticketCreate a ticket
Function parseUTF8
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseUTF8(input, offset, length) {
var output = "";
var utf16;
var pos = offset;
- Create a ticketCreate a ticket
Function LocationSubModule
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var LocationSubModule = function(main_nutella) {
this.nutella = main_nutella;
this._resources = {};
this._room = undefined;
- Create a ticketCreate a ticket
Function show
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
- Create a ticketCreate a ticket
Method start_app_bots
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.start_app_bots( app_id, app_path )
app_bots_list = Nutella.current_app.config['app_bots']
bots_dir = "#{app_path}/bots/"
# If app bots have been started already, then do nothing
unless Nutella::Tmux.session_exist? Nutella::Tmux.app_bot_session_name app_id
- Read upRead up
- Create a ticketCreate a ticket
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 backdrop
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
- Create a ticketCreate a ticket
Function activate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
- Create a ticketCreate a ticket
Function 1
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.NUTELLA = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/******************
* nutella_lib.js *
******************/
- Create a ticketCreate a ticket
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
- Create a ticketCreate a ticket
Function subscribe_to
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AbstractNet.prototype.subscribe_to = function(channel, callback, appId, runId, done_callback) {
// Pad channel
var padded_channel = this.pad_channel(channel, appId, runId);
// Maintain unique subscriptions
if(this.subscriptions.indexOf(padded_channel)>-1)
- Create a ticketCreate a ticket
Function 11
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],11:[function(require,module,exports){
/**
* Run-level Logging APIs for nutella
*/
- Create a ticketCreate a ticket
Function 4
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./app_log":4,"./app_net":5}],4:[function(require,module,exports){
/**
* App-level log APIs for nutella
*/
- Create a ticketCreate a ticket
Function 7
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./fr_log":7,"./fr_net":8}],7:[function(require,module,exports){
/**
* Framework-level log APIs for nutella
*/
- Create a ticketCreate a ticket
Function restore
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ClientImpl.prototype.restore = function(key) {
var value = localStorage.getItem(key);
var storedMessage = JSON.parse(value);
var wireMessage = new WireMessage(storedMessage.type, storedMessage);
- Create a ticketCreate a ticket
Function md51_array
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
md51_array = function (a) {
var n = a.length,
state = [1732584193, -271733879, -1732584194, 271733878],
i,
length,
- Create a ticketCreate a ticket
Function md51
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
md51 = function (s) {
var n = s.length,
state = [1732584193, -271733879, -1732584194, 271733878],
i,
length,
- Create a ticketCreate a ticket
Method validate_template
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def validate_template( dir )
# Parse and validate the template's nutella.json file
begin
template_nutella_file_json = JSON.parse(IO.read("#{dir}/nutella.json"))
rescue
- Read upRead up
- Create a ticketCreate a ticket
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"