meteor/meteor

View on GitHub
packages/hot-module-replacement/client.js

Summary

Maintainability
D
2 days
Test Coverage

File client.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// TODO: add an api to Reify to update cached exports for a module
var ReifyEntry = require('/node_modules/meteor/modules/node_modules/@meteorjs/reify/lib/runtime/entry.js')

var SOURCE_URL_PREFIX = "meteor://\ud83d\udcbbapp";

Severity: Minor
Found in packages/hot-module-replacement/client.js - About 4 hrs to fix

    Function handleMessage has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    function handleMessage(message) {
      if (message.type === 'register-failed') {
        if (message.reason === 'wrong-app') {
          console.log('HMR: A different app is running on', Meteor.absoluteUrl());
          console.log('HMR: Once you start this app again reload the page to re-enable HMR');
    Severity: Minor
    Found in packages/hot-module-replacement/client.js - About 3 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 handleMessage has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function handleMessage(message) {
      if (message.type === 'register-failed') {
        if (message.reason === 'wrong-app') {
          console.log('HMR: A different app is running on', Meteor.absoluteUrl());
          console.log('HMR: Once you start this app again reload the page to re-enable HMR');
    Severity: Major
    Found in packages/hot-module-replacement/client.js - About 2 hrs to fix

      Function applyChangeset has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function applyChangeset(options) {
        var changedFiles = options.changedFiles;
        var addedFiles = options.addedFiles;
      
        var canApply = true;
      Severity: Minor
      Found in packages/hot-module-replacement/client.js - About 1 hr to fix

        Function connect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function connect() {
          if (useHotCodePush) {
            // The page will reload, no reason to
            // connect and show more logs in the console
            return;
        Severity: Minor
        Found in packages/hot-module-replacement/client.js - About 1 hr to fix

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

          module.constructor.prototype._reset = function (id) {
            var moduleId = id || this.id;
            var file = findFile(moduleId);
          
            var hotState = file.module._hotState;
          Severity: Minor
          Found in packages/hot-module-replacement/client.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                return;
            Severity: Major
            Found in packages/hot-module-replacement/client.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return forceReload();
              Severity: Major
              Found in packages/hot-module-replacement/client.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return;
                Severity: Major
                Found in packages/hot-module-replacement/client.js - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status