biocore / biocore/empress

Avoid referring to private variables from outside of their scope

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
refactoring
Dominant language
JavaScript
Stars
56
Forks
32
PR merge metrics
No merged PRs in 30d

Description

There are a lot of places in the code (many of which are my bad) where private variables are referred to in another context: for example, the `select-node-menu.js` file refers to `this.empress._featureMetadataColumns`, `this.empress._tipMetadata`, `this.empress._biom`, etc. pretty frequently.

Ideally, these references should be replaced with calls to new "getter" functions which return copies of the private variables / needed data. That, or these variables should no longer be annotated in the code as `@private` (and they shouldn't have the leading underscore characters).

This isn't a major issue or anything, but I think having this addressed will make testing a bit easier.

Contributor guide

Open the contributing guide

Research direction

Start by auditing the cross-context references mentioned in select-node-menu.js, including _featureMetadataColumns, _tipMetadata, and _biom. Determine whether the project’s intended direction is getter functions returning copies or removing the private annotations and leading underscores. Done means the out-of-scope references are consistently addressed and the related testing behavior is easier to support.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.