Showing 34 of 52 total issues
Function fileTreeHash
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fileTreeHash: computed('model.files.@each.filePath', function() {
const files = this.get('model.files') || [];
return files.reduce((accumulator, file) => {
if (!file) {
Function didReceiveAttrs
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
if(!this.element) {
return;
}
Function compileGist
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
compileGist(gist) {
let errors = [];
let out = [];
let cssOut = [];
Function initializeColumns
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeColumns() {
const files = this.get('model.files');
if (!files) {
return;
Function babelOpts
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function babelOpts(moduleName) {
return {
presets: [['env', {
targets: {
Function fileTreeData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
fileTreeData: computed('fileTreeHash', function() {
const fileTreeHash = this.fileTreeHash;
const fileTreeKeys = Object.keys(fileTreeHash);
const fileTreeObjects = fileTreeKeys.map(key => fileTreeHash[key]);
Avoid deeply nested control flow statements. Open
if (addon.error_log) {
console.error(addon.error_log);
}
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(environment) {
let deployTarget = process.env.DEPLOY_TARGET;
let rootURL = process.env.TWIDDLE_ROOT_URL || '/';
let host = process.env.GH_API_HOST || 'https://api.github.com';
let toriiGHEBaseURL = process.env.TORII_GHE_OAUTH || null;
- 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 buildDependencies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
buildDependencies(twiddleJSON) {
let deps = twiddleJSON.dependencies;
let depCssLinkTags = '';
let depScriptTags = '';
let testStuff = '';
- 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 error
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
error(error) {
if (error && error.errors && error.errors.length > 0) {
let error1 = error.errors[0];
if (error1.status === "404") {
if (alert) {
- 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 serializeHasMany
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
serializeHasMany(snapshot, json, relationship) {
if (relationship.key === 'files') {
this.serializeFiles(snapshot, json, relationship);
}
else {
- 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 addFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async addFile(type) {
let replacements = {};
let isGlimmer = await this.emberCli.twiddleJson.hasAddon(this.model, '@glimmer/component');
if (type === 'component-js') {
- 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 exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(defaults) {
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
- 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 buildProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
buildProperties(type, replacements) {
if (type in availableBlueprints) {
let blueprint = availableBlueprints[type];
let content = blueprints[blueprint.blueprint];
- 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"