opencode-sonarqube 0.1.23 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -17989,7 +17989,7 @@ class SourcesAPI {
17989
17989
  this.formatFileLocation(filePath, issue2.line),
17990
17990
  `**Rule:** \`${issue2.rule}\``
17991
17991
  ];
17992
- const hasSourceContext = issue2.sourceContext && issue2.sourceContext.lines.length > 0;
17992
+ const hasSourceContext = (issue2.sourceContext?.lines.length ?? 0) > 0;
17993
17993
  if (hasSourceContext) {
17994
17994
  lines.push(...this.formatSourceBlock(issue2.sourceContext, issue2.line));
17995
17995
  }
@@ -18041,7 +18041,7 @@ class DuplicationsAPI {
18041
18041
  });
18042
18042
  const duplicatedComponents = components.components.filter((c) => {
18043
18043
  const measure = c.measures.find((m) => m.metric === "duplicated_lines_density");
18044
- return measure && Number.parseFloat(measure.value) > 0;
18044
+ return measure ? Number.parseFloat(measure.value) > 0 : false;
18045
18045
  }).slice(0, limit);
18046
18046
  const allDuplications = [];
18047
18047
  for (const component of duplicatedComponents) {
@@ -20391,7 +20391,7 @@ After fixing, I will re-run the analysis to verify.`;
20391
20391
  });
20392
20392
  if (config2.autoFix && lastAnalysisResult) {
20393
20393
  const state = await getProjectState(getDirectory());
20394
- if (state && state.projectKey) {
20394
+ if (state?.projectKey) {
20395
20395
  const api2 = createSonarQubeAPI(config2, state);
20396
20396
  const issues = await api2.issues.getFormattedIssues({
20397
20397
  projectKey: state.projectKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "0.1.23",
3
+ "version": "0.2.0",
4
4
  "description": "OpenCode Plugin for SonarQube integration - Enterprise-level code quality from the start",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "homepage": "https://github.com/mguttmann/opencode-sonarqube#readme",
39
39
  "dependencies": {
40
40
  "@opencode-ai/plugin": "^1.1.34",
41
- "opencode-sonarqube": "0.1.23",
41
+ "opencode-sonarqube": "0.2.0",
42
42
  "zod": "^3.24.0"
43
43
  },
44
44
  "devDependencies": {