File builder.js
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'underscore';
import url from 'url';
import { Console } from '../console/console.js';
import buildmessage from '../utils/buildmessage.js';
import files from '../fs/files';
Function initalizeDefaults
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
initalizeDefaults() {
let { cordovaServerPort } = this.options;
// if --cordova-server-port is not present on run command
if (!cordovaServerPort) {
cordovaServerPort = CordovaBuilder.createCordovaServerPort(
Function writeConfigXmlAndCopyResources
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
writeConfigXmlAndCopyResources(shouldCopyResources = true) {
let config = XmlBuilder.create({ version: '1.0' }).ele('widget');
// Set the root attributes
_.each({
Function createAppConfiguration
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createAppConfiguration(builder) {
const { settingsFile } = builder.options;
let settings = null;
if (settingsFile) {
settings = optimisticReadJsonOrNull(settingsFile);
Function initalizeDefaults
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
initalizeDefaults() {
let { cordovaServerPort } = this.options;
// if --cordova-server-port is not present on run command
if (!cordovaServerPort) {
cordovaServerPort = CordovaBuilder.createCordovaServerPort(
- 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 createAppConfiguration
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function createAppConfiguration(builder) {
const { settingsFile } = builder.options;
let settings = null;
if (settingsFile) {
settings = optimisticReadJsonOrNull(settingsFile);
- 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 _configureAndCopySplashImages
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_configureAndCopySplashImages(allowedValues, xmlElement, isIos = false) {
const appendDarkMode = (stringValue , { separator = '.', withChar = '~' } = {}) => {
if (!stringValue) {
throw new Error("No string was passed.");
}
Function generateBootstrapPage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateBootstrapPage(applicationPath, program, publicSettings) {
const meteorRelease =
release.current.isCheckout() ? "none" : release.current.name;
const hmrVersion =
this.options.buildMode === 'development' ? Date.now() : undefined
Function _configureAndCopySplashImages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_configureAndCopySplashImages(allowedValues, xmlElement, isIos = false) {
const appendDarkMode = (stringValue , { separator = '.', withChar = '~' } = {}) => {
if (!stringValue) {
throw new Error("No string was passed.");
}
- 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"