Variable name is too small
543 const headName: string = repo.getHead().getName();
544
545 if (opts.output === 'json' || opts.output === 'json-pretty') {
546 const o = { commits, refs, head: repo.getHead().isDetached() ? headHash : headName };547
548 process.stdout.write(JSON.stringify(o, (key, value) => {
549 if (value instanceof Commit) {
Variable name is too small
415 const index: Index = getIndex(repo, opts.index);
416
417 if (opts.output === 'json' || opts.output === 'json-pretty') {
418 const o = { new: newe, modified, deleted };419
420 process.stdout.write(JSON.stringify(o, (key, value) => {
421 if (value instanceof StatusEntry) {
Description
Single character variable names affect code readability and complicate code refactoring, because of the difficulty in searching and replacing single characters.
This issue will not be raised for certain special identifiers, such as i
, j
or n
. It will also not be reported for the parameters used in for
and while
loops.
Bad Practice
var a;
const l = 90
Recommended
var age;
const limit = 90;
for(let o = 2; o < 10; o++){
sum += o
}