Skip to content

Feature/devin 20260712 sonar cleanup simples#97

Merged
afonsoft merged 2 commits into
feature/devin-20260712-sonar-complexidade-metar-chunks-fixfrom
feature/devin-20260712-sonar-cleanup-simples
Jul 12, 2026
Merged

Feature/devin 20260712 sonar cleanup simples#97
afonsoft merged 2 commits into
feature/devin-20260712-sonar-complexidade-metar-chunks-fixfrom
feature/devin-20260712-sonar-cleanup-simples

Conversation

@afonsoft

@afonsoft afonsoft commented Jul 12, 2026

Copy link
Copy Markdown
Owner

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Open in Devin Review

unknown and others added 2 commits July 12, 2026 04:03
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@afonsoft
afonsoft merged commit 0037993 into feature/devin-20260712-sonar-complexidade-metar-chunks-fix Jul 12, 2026
9 of 13 checks passed
@afonsoft

Copy link
Copy Markdown
Owner Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@afonsoft
afonsoft deleted the feature/devin-20260712-sonar-cleanup-simples branch July 12, 2026 18:28
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Open in Devin Review

Comment on lines 84 to 88
/// </summary>
/// <param name="rawMetar"></param>
/// <returns></returns>
public DecodedMetar ParseNotStrict(string rawMetar)
public static DecodedMetar ParseNotStrict(string rawMetar)
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Breaking public API change: ParseStrict and ParseNotStrict are now static

Converting ParseStrict and ParseNotStrict from instance methods to static methods on both MetarDecoder (src/Metar.Decoder/MetarDecoder.cs:75,87) and TafDecoder (src/Taf.Decoder/TafDecoder.cs:69,81) is a breaking change for any external consumers who call these methods on an instance (e.g., decoder.ParseStrict(...)). While the tests have been updated, any downstream NuGet package consumers would get a compile error after upgrading. This is intentional given the test updates, but should be noted in a CHANGELOG or release notes since this library is published as a NuGet package.

(Refers to lines 75-88)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

}

remaining = ParseEntitiesChunk(evolution, remaining, decodedTaf);
ParseEntitiesChunk(evolution, remaining, decodedTaf);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 EvolutionChunkDecoder.Remaining is never set on the success path

The Remaining property (src/Taf.Decoder/ChunkDecoder/EvolutionChunkDecoder.cs:38) is only set in the early-return path at line 65 when the regex doesn't match. On the success path (line 95), ParseEntitiesChunk is called but its return value is discarded — and Remaining is never assigned. The caller at src/Taf.Decoder/TafDecoder.cs:165 reads evolutionDecoder.Remaining to advance the while loop. When parsing succeeds, Remaining stays null, causing string.IsNullOrEmpty(null) to be true, which terminates the loop. This means only ONE evolution block is parsed per Parse call, and the loop relies on the Consume regex removing the matched evolution from the input so that newRemainingTaf (which is NOT stored in Remaining) advances. This is a pre-existing design issue not introduced by this PR, but the PR's removal of remaining = ParseEntitiesChunk(...) makes it more visible that the return value was always unused.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

entityName = VisibilityChunkDecoder.VisibilityParameterName;
}
var entity = result.Count > 0 ? result[entityName] : null;
var entity = result[entityName];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 Info: Subtle behavioral change when result dictionary is empty in evolution parsing

The change from var entity = result.Count > 0 ? result[entityName] : null to var entity = result[entityName] at src/Taf.Decoder/ChunkDecoder/EvolutionChunkDecoder.cs:138 changes the exception type thrown when result is empty. Previously, entity would be null and the code would throw a TafChunkDecoderException at line 143. Now, if result is empty, entityName would be null (from FirstOrDefault()) and result[null] would throw a KeyNotFoundException. Both are caught by the generic catch (Exception) at line 158, so the end behavior is similar. In practice, chunk decoders always return non-empty result dictionaries, so this path is unlikely to be reached.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant