Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VDYP-206 FIPStart output to VRIAdjust input format #26

Merged
merged 15 commits into from
Jan 31, 2024
Merged

Conversation

smithkm
Copy link
Collaborator

@smithkm smithkm commented Dec 5, 2023

Do not review until #25 is merged

@smithkm smithkm changed the title FIPStart output to VRIAdjust input format VDYP-206 FIPStart output to VRIAdjust input format Dec 5, 2023
Copy link

sonarqubecloud bot commented Dec 5, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 5 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 617 Code Smells

80.4% 80.4% Coverage
11.8% 11.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@smithkm smithkm closed this Jan 26, 2024
@smithkm smithkm reopened this Jan 26, 2024
@smithkm smithkm force-pushed the feature/VDYP-206 branch 4 times, most recently from 4c14955 to 350c81d Compare January 26, 2024 22:25
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

17 New issues
0 Security Hotspots
82.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud


public BaseVdypLayer(String polygonIdentifier, Layer layer) {
super();
this.polygonIdentifier = polygonIdentifier;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that polygonIdentifier and layer are not Optionals, I'm assuming that these arguments can't be null. Should an IllegalArgumentException be thrown if they are?

String polygonIdentifier, PA percentAvailable, String fiz, String becIdentifier, Optional<FipMode> modeFip
) {
super();
this.forestInventoryZone = fiz;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the non-Optionals can't be null, throw an IllegalArgumentException here when they are.

return polygonIdentifier;
}

public void setPolygonIdentifier(String polygonIdentifier) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above.


Map<String, Float> speciesPercent; // Map from

protected BaseVdypSpecies(String polygonIdentifier, Layer layer, String genus) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add throws of IllegalArgumentException when fields that are not nullable (e.g. polygonIdentifier?) are supplied as null.

}
}

private final Map<String, BecDefinition> becMap;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard practice is for fields to be listed before the method definitions.

return baseBec;
}
return new BecDefinition(
baseBec, defaultBec, !NON_GROWTH_BECS.contains(baseBec.getAlias()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use isGrowth, etc, from above.

public static final String CONTROL_KEY = "BREAKAGE";

public BreakageParser() {
super(Integer.class, 1, CONTROL_KEY);
this.groupIndexKey(40);
this.groupIndexKey(MAX_GROUPS);
this.coefficients(6, 9);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "6"? There's only 4 coordinates per line


public CloseUtilVolumeParser() {
super(1, CONTROL_KEY);
this.ucIndexKey().space(1).groupIndexKey(MAX_GROUPS).coefficients(4, 10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "4"? There's only three coefficients...

@@ -16,7 +15,7 @@
* @author Kevin Smith, Vivid Solutions
*
*/
public class BySpeciesDqCoefficientParser implements ControlMapSubResourceParser<List<Coefficients>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in Word document

public static final float PI_40K = 0.78539816E-04f;

// FT_BD
public static float treesPerHectare(float baseArea, float quadraticMeanDiameter) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should adopt a naming convention wherein units are always suffixed to variable names. In this case, "baseArea" is a number, but what are the units? It's apparent that they're hectares but this should be made explicit. For time, I always use _ms = milliseconds, _s = seconds, and _m, _h, _d, _w, _y. For area, I suggest _h for hectares. I'm not sure what other ones are used in the system. Suggestions?

@mjunkin mjunkin merged commit c3f4236 into main Jan 31, 2024
2 checks passed
vividroyjeong added a commit that referenced this pull request Sep 11, 2024
Remove keep_versions for initial deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants