lifeart/ember-ast-hot-load

View on GitHub
lib/hot-reloader.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function HotReloader has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function HotReloader(options) {
  var fsWatcher = options.watcher;
  var ui = options.ui;
  var _isRunning = false;
  var lsProxy = options.ssl ? require('https') : require('http');
Severity: Major
Found in lib/hot-reloader.js - About 2 hrs to fix

    Function HotReloader has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function HotReloader(options) {
      var fsWatcher = options.watcher;
      var ui = options.ui;
      var _isRunning = false;
      var lsProxy = options.ssl ? require('https') : require('http');
    Severity: Minor
    Found in lib/hot-reloader.js - About 2 hrs 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

    Function fileDidChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async function fileDidChange(results) {
        var filePath = results.filePath || '';
    
        ui.writeLine(filePath);
    
    
    Severity: Minor
    Found in lib/hot-reloader.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status