Showing 7 of 63 total issues

Function 1 has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.bock=e()}}(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){
var _ = require('./utils')
var store = require('./store')
var Proxy = require('./proxy')

Severity: Major
Found in bock.js - About 4 hrs to fix

    File bock.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.bock=e()}}(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){
    var _ = require('./utils')
    var store = require('./store')
    var Proxy = require('./proxy')
    
    
    Severity: Minor
    Found in bock.js - About 2 hrs to fix

      Function 4 has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{}],4:[function(require,module,exports){
      var serviceWorker = navigator.serviceWorker
      var serviceInstance = null
      var serviceWorkerInstance = null
      
      
      Severity: Major
      Found in bock.js - About 2 hrs to fix

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

        },{"./proxy":3,"./store":5,"./utils":6}],2:[function(require,module,exports){
        var Bock = require('./bock')
        var store = require('./store')
        var service = require('./service')
        var merge = require('./utils').merge
        Severity: Minor
        Found in bock.js - About 1 hr to fix

          Function 3 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"./bock":1,"./service":4,"./store":5,"./utils":6}],3:[function(require,module,exports){
          module.exports = Proxy
          
          function Proxy() {}
          
          
          Severity: Minor
          Found in bock.js - About 1 hr to fix

            Function 5 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{}],5:[function(require,module,exports){
            var buf = []
            var store = exports
            
            store.append = function (data) {
            Severity: Minor
            Found in bock.js - About 1 hr to fix

              Function uuid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.uuid = function () {
                var uuid = '', i, random
                for (i = 0; i < 32; i++) {
                  random = Math.random() * 16 | 0;
                  if (i === 8 || i === 12 || i === 16 || i === 20) uuid += '-'
              Severity: Minor
              Found in lib/utils.js - About 55 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language