Skip to content

Commit 529d605

Browse files
committed
fix: code review improvements
1 parent 0829e65 commit 529d605

File tree

6 files changed

+288
-198
lines changed

6 files changed

+288
-198
lines changed

plugin/src/main/java/io/snyk/eclipse/plugin/html/BaseHtmlProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import org.eclipse.core.runtime.Platform;
88
import org.eclipse.jface.resource.ColorRegistry;
9-
import org.eclipse.jface.resource.FontRegistry;
109
import org.eclipse.jface.resource.JFaceResources;
1110
import org.eclipse.swt.graphics.Color;
1211
import org.eclipse.swt.graphics.RGB;
@@ -142,8 +141,10 @@ private String getScaledFontSize() {
142141
} catch (IllegalStateException e) {
143142
defaultHeight = 13;
144143
}
145-
// Language server HTML assumes a base font size of 10px. The default Eclipse font size is 17px (13pt), so we
146-
// apply a scaling factor here. This ensures that HTML fonts scale correctly if the user changes the text size.
144+
// Language server HTML assumes a base font size of 10px. The default Eclipse
145+
// font size is 17px (13pt), so we
146+
// apply a scaling factor here. This ensures that HTML fonts scale correctly if
147+
// the user changes the text size.
147148
int scaledHeight = (int) (defaultHeight / 1.7);
148149
return scaledHeight + "pt";
149150
}

plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/ISnykToolView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ static String getPlural(long count) {
128128
*/
129129
abstract void disableDelta();
130130

131-
abstract void selectTreeNode(Issue issue, String product);
131+
abstract void selectTreeNode(Issue issue);
132132
}

plugin/src/main/java/io/snyk/eclipse/plugin/views/snyktoolview/SnykToolView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,12 @@ protected void outputCommandResult(Object result) {
480480
}
481481

482482
@Override
483-
public void selectTreeNode(Issue issue, String product) {
483+
public void selectTreeNode(Issue issue) {
484484
ProductTreeNode productNode = getProductNode(ProductConstants.DISPLAYED_CODE_SECURITY, issue.filePath());
485-
drillDown((TreeNode) productNode, issue);
485+
selectTreenodeForIssue((TreeNode) productNode, issue);
486486
}
487487

488-
private void drillDown(TreeNode currentParent, Issue issue) {
488+
private void selectTreenodeForIssue(TreeNode currentParent, Issue issue) {
489489
for (Object child : currentParent.getChildren()) {
490490
TreeNode childNode = (TreeNode) child;
491491

@@ -495,7 +495,7 @@ private void drillDown(TreeNode currentParent, Issue issue) {
495495
}
496496

497497
if (childNode.getChildren() != null && childNode.getChildren().length != 0) {
498-
drillDown(childNode, issue);
498+
selectTreenodeForIssue(childNode, issue);
499499
}
500500
}
501501
}

0 commit comments

Comments
 (0)