SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.fsklab.deprecatednodes/js-src/de/bund/bfr/knime/fsklab/nodes/joiner/jointjs/backbone.js

Summary

Maintainability
F
4 days
Test Coverage

File backbone.js has 1154 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//     Backbone.js 1.3.3

//     (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:

Function set has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    set: function(models, options) {
      if (models == null) return;

      options = _.extend({}, setOptions, options);
      if (options.parse && !this._isModel(models)) {

Function set has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    set: function(key, val, options) {
      if (key == null) return this;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      var attrs;

Function start has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    start: function(options) {
      if (History.started) throw new Error('Backbone.history has already been started');
      History.started = true;

      // Figure out the initial configuration. Do we need an iframe?

Function offApi has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var offApi = function(events, name, callback, options) {
    if (!events) return;

    var i = 0, listening;
    var context = options.context, listeners = options.listeners;

Function sync has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Backbone.sync = function(method, model, options) {
    var type = methodMap[method];

    // Default options, unless specified.
    _.defaults(options || (options = {}), {

Function save has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    save: function(key, val, options) {
      // Handle both `"key", value` and `{key: value}` -style arguments.
      var attrs;
      if (key == null || typeof key === 'object') {
        attrs = key;

Function navigate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    navigate: function(fragment, options) {
      if (!History.started) return false;
      if (!options || options === true) options = {trigger: !!options};

      // Normalize the fragment.

Consider simplifying this complex logical expression.
Open

    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
      params.contentType = 'application/json';
      params.data = JSON.stringify(options.attrs || model.toJSON(options));
    }

Function internalOn has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  var internalOn = function(obj, name, callback, context, listening) {

Function eventsApi has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  var eventsApi = function(iteratee, events, name, callback, opts) {

Avoid too many return statements within this function.
Open

      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;

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

  var root = (typeof self == 'object' && self.self === self && self) ||
            (typeof global == 'object' && global.global === global && global);
de.bund.bfr.knime.fsklab.deprecatednodes/js-src/de/bund/bfr/knime/fsklab/nodes/joiner/jointjs/underscore.js on lines 14..15

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 49.

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

There are no issues that match your filters.

Category
Status