nutella-framework/nutella_framework

View on GitHub

Showing 196 of 196 total issues

File nutella_lib.js has 2793 lines of code (exceeds 250 allowed). Consider refactoring.
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 *
 ******************/

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 1 wk to fix

Function 15 has 1340 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./paho/mqttws31":15}],15:[function(require,module,exports){
/*******************************************************************************
 * Copyright (c) 2013 IBM Corp.
 *
 * All rights reserved. This program and the accompanying materials
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 6 days to fix

Function MQTT has 1334 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Paho.MQTT = (function (global) {

    // Private variables below, these are only visible inside the function closure
    // which is used to define the module. 

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 6 days to fix

File bootstrap.js has 1548 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.4 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in framework_components/room-debugger/js/bootstrap.js - About 4 days to fix

Similar blocks of code found in 3 locations. Consider refactoring.
Open

},{"./fr_log":7,"./fr_net":8}],7:[function(require,module,exports){
/**
 * Framework-level log APIs for nutella
 */

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 2 other locations - About 2 days to fix
framework_components/room-debugger/js/nutella_lib.js on lines 724..776
framework_components/room-debugger/js/nutella_lib.js on lines 2045..2097

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 411.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

},{"./app_log":4,"./app_net":5}],4:[function(require,module,exports){
/**
 * App-level log APIs for nutella
 */

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 2 other locations - About 2 days to fix
framework_components/room-debugger/js/nutella_lib.js on lines 1075..1127
framework_components/room-debugger/js/nutella_lib.js on lines 2045..2097

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 411.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

},{}],11:[function(require,module,exports){
/**
 * Run-level Logging APIs for nutella
 */

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 2 other locations - About 2 days to fix
framework_components/room-debugger/js/nutella_lib.js on lines 724..776
framework_components/room-debugger/js/nutella_lib.js on lines 1075..1127

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 411.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function 2 has 343 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./nutella_i_browser":9,"./version":17}],2:[function(require,module,exports){
/*jshint bitwise:false*/
/*global unescape*/

(function (factory) {
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 1 day to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    Object.defineProperty(virtualResource, 'notifyEnter', {
        get: function () {
            return enterResources.indexOf(virtualResource.rid) != -1;
        },
        set: function (condition) {
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 1 other location - About 1 day to fix
framework_components/room-debugger/js/nutella_lib.js on lines 1970..1996

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 279.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    Object.defineProperty(virtualResource, 'notifyExit', {
        get: function () {
            return exitResources.indexOf(virtualResource.rid) != -1;
        },
        set: function (condition) {
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 1 other location - About 1 day to fix
framework_components/room-debugger/js/nutella_lib.js on lines 1942..1968

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 279.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function 10 has 230 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./app_core_browser":3,"./fr_core_browser":6,"./run_location":10,"./run_log":11,"./run_net":12,"./simple-mqtt-client/client-browser":14}],10:[function(require,module,exports){
var LocationSubModule = function(main_nutella) {
    this.nutella = main_nutella;

    this._resources = {};
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 1 day to fix

Function Client has 221 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var Client = function (host, port, path, clientId) {
        
        var uri;
        
        if (typeof host !== "string")
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 1 day to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    var mqtt_cb = function(mqtt_message, mqtt_channel) {
        try {
            var f = JSON.parse(mqtt_message);
            var f1 = extractRunIdAndAppId(mqtt_channel);
            // Only handle requests that have proper id set
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 1 other location - About 6 hrs to fix
framework_components/room-debugger/js/nutella_lib.js on lines 1586..1603

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 172.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    var mqtt_cb = function(mqtt_message, mqtt_channel) {
        try {
            var f = JSON.parse(mqtt_message);
            var f1 = extractRunIdAndAppId(mqtt_channel);
            // Only handle requests that have proper id set
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js and 1 other location - About 6 hrs to fix
framework_components/room-debugger/js/nutella_lib.js on lines 1389..1406

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 172.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function 8 has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"./app_net":5}],8:[function(require,module,exports){
/**
 * Framework-level Networking APIs for nutella
 */

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 6 hrs to fix

Function 16 has 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],16:[function(require,module,exports){
/**
 * Network APIs abstraction
 */

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 6 hrs to fix

Function 14 has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"spark-md5":2}],14:[function(require,module,exports){
/**********************
 * Simple MQTT client *
 **********************/

Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 5 hrs to fix

Function encode has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    WireMessage.prototype.encode = function() {
        // Compute the first byte of the fixed header
        var first = ((this.type & 0x0f) << 4);
        
        /*
Severity: Major
Found in framework_components/room-debugger/js/nutella_lib.js - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.tooltip')
      var options = typeof option == 'object' && option
Severity: Major
Found in framework_components/room-debugger/js/bootstrap.js and 1 other location - About 5 hrs to fix
framework_components/room-debugger/js/bootstrap.js on lines 1801..1811

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 137.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.popover')
      var options = typeof option == 'object' && option
Severity: Major
Found in framework_components/room-debugger/js/bootstrap.js and 1 other location - About 5 hrs to fix
framework_components/room-debugger/js/bootstrap.js on lines 1692..1702

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 137.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language