Global Metrics
path: .metrics.mi.mi_sei
old: 14.693989182631988
new: 41.02668307155135
path: .metrics.mi.mi_visual_studio
old: 25.52331254267134
new: 32.16543742189723
path: .metrics.mi.mi_original
old: 43.64486444796799
new: 55.00289799144427
path: .metrics.nargs.average
old: 0.25
new: 1.0
path: .metrics.cognitive.sum
old: 17.0
new: 1.0
path: .metrics.cognitive.average
old: 4.25
new: 1.0
path: .metrics.nexits.sum
old: 12.0
new: 15.0
path: .metrics.nexits.average
old: 3.0
new: 15.0
path: .metrics.halstead.level
old: 0.03758169934640523
new: 0.1607142857142857
path: .metrics.halstead.N1
old: 277.0
new: 74.0
path: .metrics.halstead.effort
old: 87773.80789120407
new: 4676.477634939947
path: .metrics.halstead.n1
old: 24.0
new: 10.0
path: .metrics.halstead.N2
old: 204.0
new: 56.0
path: .metrics.halstead.estimated_program_length
old: 710.206799974553
new: 280.35267028370896
path: .metrics.halstead.vocabulary
old: 116.0
new: 55.0
path: .metrics.halstead.difficulty
old: 26.60869565217391
new: 6.222222222222222
path: .metrics.halstead.volume
old: 3298.688858656362
new: 751.5767627582057
path: .metrics.halstead.n2
old: 92.0
new: 45.0
path: .metrics.halstead.purity_ratio
old: 1.4765214136685092
new: 2.1565590021823766
path: .metrics.halstead.length
old: 481.0
new: 130.0
path: .metrics.halstead.time
old: 4876.322660622448
new: 259.8043130522193
path: .metrics.halstead.bugs
old: 0.6583477744834666
new: 0.09321618390042707
path: .metrics.nom.total
old: 4.0
new: 1.0
path: .metrics.nom.functions
old: 4.0
new: 1.0
path: .metrics.loc.blank
old: 14.0
new: 19.0
path: .metrics.loc.sloc
old: 139.0
new: 119.0
path: .metrics.loc.ploc
old: 109.0
new: 69.0
path: .metrics.loc.lloc
old: 44.0
new: 33.0
path: .metrics.loc.cloc
old: 16.0
new: 31.0
path: .metrics.cyclomatic.average
old: 3.2857142857142856
new: 9.0
path: .metrics.cyclomatic.sum
old: 23.0
new: 18.0
Spaces Data
Minimal test - lines (51, 115)
path: .spaces[0].metrics.nexits.sum
old: 12.0
new: 15.0
path: .spaces[0].metrics.nexits.average
old: 3.0
new: 15.0
path: .spaces[0].metrics.nom.total
old: 4.0
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 4.0
new: 1.0
path: .spaces[0].metrics.loc.cloc
old: 7.0
new: 23.0
path: .spaces[0].metrics.loc.blank
old: 12.0
new: 0.0
path: .spaces[0].metrics.loc.lloc
old: 44.0
new: 33.0
path: .spaces[0].metrics.loc.ploc
old: 97.0
new: 50.0
path: .spaces[0].metrics.loc.sloc
old: 116.0
new: 65.0
path: .spaces[0].metrics.cyclomatic.sum
old: 22.0
new: 17.0
path: .spaces[0].metrics.cyclomatic.average
old: 3.6666666666666665
new: 17.0
path: .spaces[0].metrics.nargs.average
old: 0.25
new: 1.0
path: .spaces[0].metrics.mi.mi_original
old: 47.00353352914064
new: 66.04218906087591
path: .spaces[0].metrics.mi.mi_sei
old: 12.923074829340395
new: 61.13542090149747
path: .spaces[0].metrics.mi.mi_visual_studio
old: 27.487446508269382
new: 38.62116319349469
path: .spaces[0].metrics.cognitive.sum
old: 17.0
new: 1.0
path: .spaces[0].metrics.cognitive.average
old: 4.25
new: 1.0
path: .spaces[0].metrics.halstead.N1
old: 277.0
new: 71.0
path: .spaces[0].metrics.halstead.level
old: 0.03565292096219931
new: 0.15348837209302324
path: .spaces[0].metrics.halstead.difficulty
old: 28.048192771084334
new: 6.515151515151516
path: .spaces[0].metrics.halstead.N2
old: 194.0
new: 43.0
path: .spaces[0].metrics.halstead.n1
old: 24.0
new: 10.0
path: .spaces[0].metrics.halstead.vocabulary
old: 107.0
new: 43.0
path: .spaces[0].metrics.halstead.bugs
old: 0.6647610224857744
new: 0.08441746621585895
path: .spaces[0].metrics.halstead.n2
old: 83.0
new: 33.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.3570432543929989
new: 1.751616551646514
path: .spaces[0].metrics.halstead.time
old: 4947.749433055569
new: 223.901934575334
path: .spaces[0].metrics.halstead.estimated_program_length
old: 639.1673728191025
new: 199.6842868877026
path: .spaces[0].metrics.halstead.effort
old: 89059.48979500025
new: 4030.234822356013
path: .spaces[0].metrics.halstead.length
old: 471.0
new: 114.0
path: .spaces[0].metrics.halstead.volume
old: 3175.23095059494
new: 618.5941820360391
Code
inline nsresult nsresultForErrno(int aErr) {
switch (aErr) {
case 0:
return NS_OK;
#ifdef EDQUOT
case EDQUOT: /* Quota exceeded */
// FALLTHROUGH to return NS_ERROR_FILE_DISK_FULL
#endif
case ENOSPC:
return NS_ERROR_FILE_DISK_FULL;
#ifdef EISDIR
case EISDIR: /* Is a directory. */
return NS_ERROR_FILE_IS_DIRECTORY;
#endif
case ENAMETOOLONG:
return NS_ERROR_FILE_NAME_TOO_LONG;
case ENOEXEC: /* Executable file format error. */
return NS_ERROR_FILE_EXECUTION_FAILED;
case ENOENT:
return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
case ENOTDIR:
return NS_ERROR_FILE_DESTINATION_NOT_DIR;
#ifdef ELOOP
case ELOOP:
return NS_ERROR_FILE_UNRESOLVABLE_SYMLINK;
#endif /* ELOOP */
#ifdef ENOLINK
case ENOLINK:
return NS_ERROR_FILE_UNRESOLVABLE_SYMLINK;
#endif /* ENOLINK */
case EEXIST:
return NS_ERROR_FILE_ALREADY_EXISTS;
#ifdef EPERM
case EPERM:
#endif /* EPERM */
case EACCES:
return NS_ERROR_FILE_ACCESS_DENIED;
#ifdef EROFS
case EROFS: /* Read-only file system. */
return NS_ERROR_FILE_READ_ONLY;
#endif
/*
* On AIX 4.3, ENOTEMPTY is defined as EEXIST,
* so there can't be cases for both without
* preprocessing.
*/
#if ENOTEMPTY != EEXIST
case ENOTEMPTY:
return NS_ERROR_FILE_DIR_NOT_EMPTY;
#endif /* ENOTEMPTY != EEXIST */
/* Note that nsIFile.createUnique() returns
NS_ERROR_FILE_TOO_BIG when it cannot create a temporary
file with a unique filename.
See https://developer.mozilla.org/en-US/docs/Table_Of_Errors
Other usages of NS_ERROR_FILE_TOO_BIG in the source tree
are in line with the POSIX semantics of EFBIG.
So this is a reasonably good approximation.
*/
case EFBIG: /* File too large. */
return NS_ERROR_FILE_TOO_BIG;
default:
return NS_ERROR_FAILURE;
}
}