packages/hot-module-replacement/client.js
File client.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
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";
Function handleMessage
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
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');
- Read upRead up
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
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');
Function applyChangeset
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function applyChangeset(options) {
var changedFiles = options.changedFiles;
var addedFiles = options.addedFiles;
var canApply = true;
Function connect
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function connect() {
if (useHotCodePush) {
// The page will reload, no reason to
// connect and show more logs in the console
return;
Function _reset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.constructor.prototype._reset = function (id) {
var moduleId = id || this.id;
var file = findFile(moduleId);
var hotState = file.module._hotState;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return forceReload();
Avoid too many return
statements within this function. Open
Open
return;