diff --git a/js/common/view/FieldNode.ts b/js/common/view/FieldNode.ts index 1d02f4f9..2db2cc6b 100644 --- a/js/common/view/FieldNode.ts +++ b/js/common/view/FieldNode.ts @@ -29,9 +29,12 @@ type FieldNodeOptions = SelfOptions & NodeOptions; export default class FieldNode extends Node { + //REVIEW Unnecessary class field. fieldLines is private and unused outside the constructor. // The field lines are vertical lines spaced evenly along the field, according to the bin width. private fieldLines: Node[]; + //REVIEW Unnecessary class field. fieldBorder is private and unused outside the constructor. + //REVIEW Is this doc incomplete? I found fieldBorder vs fieldBackground to be confusing, especially both are filled. // The field private readonly fieldBorder: Node; @@ -135,6 +138,8 @@ export default class FieldNode extends Node { this.setClipArea( maskShape ); } + //REVIEW Document + //REVIEW This function does not access any members (no use of 'this'), so can be moved outside the class definition. private fieldLinesForBinWidth( binWidth: number ): Node[] { const totalFieldLines = PDLConstants.MAX_FIELD_DISTANCE / binWidth - 1; const deltaX = binWidth * PDLConstants.FIELD_WIDTH / PDLConstants.MAX_FIELD_DISTANCE; diff --git a/js/common/view/FieldOverlayNode.ts b/js/common/view/FieldOverlayNode.ts index b0e48150..c8ac4df1 100644 --- a/js/common/view/FieldOverlayNode.ts +++ b/js/common/view/FieldOverlayNode.ts @@ -29,6 +29,7 @@ export default class FieldOverlayNode extends Node { const options = optionize()( {}, providedOptions ); + //REVIEW move outside of class definition, const NUMBER_OF_TOTAL_DASHES = 30; const numTotalDashes = 30; const numDashesToDraw = options.isLeftSide ? 1 : numTotalDashes; diff --git a/js/common/view/FieldSignNode.ts b/js/common/view/FieldSignNode.ts index 98d0c775..036c6103 100644 --- a/js/common/view/FieldSignNode.ts +++ b/js/common/view/FieldSignNode.ts @@ -23,7 +23,7 @@ export type FieldSignNodeOptions = SelfOptions & VBoxOptions; export default class FieldSignNode extends VBox { public constructor( fieldProperty: TReadOnlyProperty, - private readonly headingText: Node, + private readonly headingText: Node, //REVIEW headingText does not need to be a class member, it's unused outside the constructor and flagged by WebStorm. selectorNode: SelectorNode, signPostHeight: number, providedOptions: FieldSignNodeOptions ) { diff --git a/js/common/view/HistogramAccordionBox.ts b/js/common/view/HistogramAccordionBox.ts index 4c680a3f..5ec43399 100644 --- a/js/common/view/HistogramAccordionBox.ts +++ b/js/common/view/HistogramAccordionBox.ts @@ -29,6 +29,7 @@ export default class HistogramAccordionBox extends AccordionBox { public constructor( content: Node, providedOptions: HistogramAccordionBoxOptions ) { + //REVIEW move outside class definition, const MARGIN = 8; const margin = 8; const options = optionize()( {