Showing 44 of 102 total issues
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function forEachLimit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async.forEachLimit = function (arr, limit, iterator, callback) {
callback = callback || function () {};
if (!arr.length || limit <= 0) {
return callback();
}
Function writeGradleFile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function writeGradleFile() {
if (!fs.existsSync(directories.android)) {
fs.mkdirSync(directories.android);
}
try {
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function writeGradleFile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function writeGradleFile() {
if (!fs.existsSync(directories.android)) {
fs.mkdirSync(directories.android);
}
try {
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init(): void {
try {
if (application.android) {
console.info('Fabric: Starting configuring Android platform');
application.android.on('activityStarted', activityEventData => {
Function logError
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
logError(error: any, msg?: string): void {
if (this.initDone) {
try {
if (!!msg) {
Crashlytics.sharedInstance().setObjectValueForKey('' + msg, "msg");
- 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 addProperties
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prompt.addProperties = function (obj, properties, callback) {
properties = properties.filter(function (prop) {
return typeof obj[prop] === 'undefined';
});
Function memoize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async.memoize = function (fn, hasher) {
var memo = {};
var queues = {};
hasher = hasher || function (x) {
return x;
Function parallel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async.parallel = function (tasks, callback) {
callback = callback || function () {};
if (tasks.constructor === Array) {
async.map(tasks, function (fn, callback) {
if (fn) {
Function series
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async.series = function (tasks, callback) {
callback = callback || function () {};
if (tasks.constructor === Array) {
async.mapSeries(tasks, function (fn, callback) {
if (fn) {
Function applyTheme
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function applyTheme(theme) {
//
// Remark: This is a list of methods that exist
// on String that you should not overwrite.
Function assembler
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get(branch, function assembler(err, line) {
if (err) {
return next(err);
}
Function convert
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function convert(schema) {
var newProps = Object.keys(validate.messages),
newSchema = false,
key;
Function waterfall
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async.waterfall = function (tasks, callback) {
callback = callback || function () {};
if (!tasks.length) {
return callback();
}
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = env => {
const platform = env && (env.android && "android" || env.ios && "ios");
if (!platform) {
throw new Error("You need to provide a target platform!");
}
- 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 validateProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function validateProperty(object, value, property, schema, options, errors) {
Avoid deeply nested control flow statements. Open
Open
if (length) {
if (tmp.length + 1 < length) {
isValid = false;
wait = true;
}
Avoid deeply nested control flow statements. Open
Open
if (object.hasOwnProperty(k)) {
visitedProps.push(k);
if (re.exec(k) !== null) {
validateProperty(object, object[k], p, props[p], options, errors);
}
Function _performValidation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
prompt._performValidation = function (name, prop, against, schema, line, callback) {