Showing 58 of 74 total issues
File hot-loader.js
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Service from '@ember/service';
import Evented from '@ember/object/evented';
import Component from '@ember/component';
import { getOwner } from '@ember/application';
import { get, computed } from '@ember/object';
File ast-transform.js
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
// builders ref https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/builders.ts
const HOT_LOAD_HELPER_NAME = 'hot-load';
// for cases like {{#let (component 'foo-bar') as |Boo|}} <Boo />a {{/let}}
var nestedNames = [];
`` has 37 functions (exceeds 20 allowed). Consider refactoring. Open
export default Service.extend(Evented, {
templateOptionsKey: null,
templateCompilerKey: null,
useOriginalVendorFile: false,
scriptDownloadErrors: 0,
File ast-transform.test.js
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* eslint-env jest */
const defaultConfig = {
addonContext: {
Function createPlugin
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function createPlugin(appName, hotReloadService, rootUrl, baseUrl) {
function Plugin(window, host) {
this.window = window;
this.host = host;
}
- 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 willHotReloadRouteTemplate
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
willHotReloadRouteTemplate(attrs) {
const meta = getPossibleRouteTemplateMeta(attrs, this.podModulePrefix);
if (!meta.looksLikeRouteTemplate) {
return;
}
- 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 createPlugin
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createPlugin(appName, hotReloadService, rootUrl, baseUrl) {
function Plugin(window, host) {
this.window = window;
this.host = host;
}
Function onFileRequested
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onFileRequested(req, res) {
var appFileName = req.params.name.split('---').join('/');
if (!appFileName.endsWith('.js')) {
return res.status(404).send('Not found');
}
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');
Function compute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
compute([
name,
context = {},
maybePropertyValue = undefined,
astStringName = '',
- 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 createASTPlugin
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createASTPlugin(config, syntax) {
let b = syntax.builders;
let options = config || { helpers: [] };
nestedNames = [];
const visitor = {
Function reload
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Plugin.prototype.reload = function (path) {
let crossOrigin;
const cancelableEvent = { modulePath: path, cancel: false, components: [] };
hotReloadService.triggerInRunLoop('willLiveReload', cancelableEvent);
if (cancelableEvent.cancel) {
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');
- 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 initialize
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export function initialize(application) {
if (typeof window !== 'object') {
return;
}
- 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 compute
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
compute([
name,
context = {},
maybePropertyValue = undefined,
astStringName = '',
Function willHotReloadRouteTemplate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
willHotReloadRouteTemplate(attrs) {
const meta = getPossibleRouteTemplateMeta(attrs, this.podModulePrefix);
if (!meta.looksLikeRouteTemplate) {
return;
}
Function clearRequirejsCache
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function clearRequirejsCache(context, componentName) {
const owner = getOwner(context);
const config = owner.resolveRegistration('config:environment');
const modulePrefix = get(config, 'modulePrefix') || 'dummy';
Function createASTPlugin
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
static createASTPlugin(config, syntax) {
let b = syntax.builders;
let options = config || { helpers: [] };
nestedNames = [];
const visitor = {
- 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 matchingComponent
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function matchingComponent(rawComponentName, path) {
if (typeof path !== 'string') {
return false;
}
if (typeof rawComponentName !== 'string') {
Function testHotReloadChangedUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function testHotReloadChangedUrl(options, expectedUrl) {
jest.mock('http');
jest.mock('https');
const http = require('http');
const https = require('https');