You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/10/27 03:58:53 UTC

[GitHub] [lucenenet] sachdevlaksh opened a new pull request, #724: changes made for Redundant jump statements #684

sachdevlaksh opened a new pull request, #724:
URL: https://github.com/apache/lucenenet/pull/724

   Changes provided for Issue #684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [lucenenet] sachdevlaksh commented on pull request #724: changes made for Redundant jump statements #684

Posted by GitBox <gi...@apache.org>.
sachdevlaksh commented on PR #724:
URL: https://github.com/apache/lucenenet/pull/724#issuecomment-1294442880

   > Thanks for the PR.
   > 
   > While you did follow the instructions that were provided in #684, they were unfortunately not detailed enough (our fault). Please make the following changes to every changed line:
   > 
   > 1. The "link to related SonarCloud issue" was meant to be a permanent link to a SonarCloud document that describes the issue (similar to how Microsoft does [CA1812](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1812)). Unfortunately, no such document for "SonarCloud S3626" comes up in a Google search, I had to search for "Code Analysis S3626" to get a hit: https://rules.sonarsource.com/csharp/RSPEC-3626.  This SonarCloud scan setup is temporary, not a permanent URL that we should put in the source code. We are working on an official SonarCloud setup in #709, but it isn't ready yet.
   > 2. Do not add an additional line for the comment, place the comment after the code that is commented on the same line. Include the `//` also.
   > 
   > ### Example
   > ```cs
   > // continue; // LUCENENET: Removed redundant jump statements. https://rules.sonarsource.com/csharp/RSPEC-3626
   > ```
   
   Thanks @NightOwl888, For the detail, I make changes asap.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [lucenenet] NightOwl888 merged pull request #724: changes made for Redundant jump statements #684

Posted by GitBox <gi...@apache.org>.
NightOwl888 merged PR #724:
URL: https://github.com/apache/lucenenet/pull/724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [lucenenet] NightOwl888 commented on a diff in pull request #724: changes made for Redundant jump statements #684

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on code in PR #724:
URL: https://github.com/apache/lucenenet/pull/724#discussion_r1007466865


##########
src/Lucene.Net/Codecs/BlockTreeTermsReader.cs:
##########
@@ -1241,7 +1241,8 @@ private void SeekToStartTerm(BytesRef target)
                                             return;
                                         }
                                     }
-                                    continue;
+                                    // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                                    continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs:
##########
@@ -176,7 +176,8 @@ public bool MoveNext()
                         {
                             if (contextField.GetBinaryValue() is null && contextField.GetStringValue() is null)
                             {
-                                continue;
+                                // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                                continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Util/Fst/FSTEnum.cs:
##########
@@ -216,7 +216,8 @@ protected virtual void DoSeekCeil()
                         Incr();
                         arc = m_fst.ReadFirstTargetArc(arc, GetArc(m_upto), m_fstReader);
                         targetLabel = TargetLabel;
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Util/Fst/FSTEnum.cs:
##########
@@ -390,7 +391,8 @@ protected virtual void DoSeekFloor()
                         Incr();
                         arc = m_fst.ReadFirstTargetArc(arc, GetArc(m_upto), m_fstReader);
                         targetLabel = TargetLabel;
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/Lucene.Net/Codecs/Compressing/LZ4.cs:
##########
@@ -640,7 +640,8 @@ public static void CompressHC(byte[] src, int srcOff, int srcLen, DataOutput @ou
                         CopyTo(match2, match1);
                         CopyTo(match3, match2);
 
-                        goto search3Continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        goto search3Continue; //NOSONAR

Review Comment:
   Please comment out this continue statement. Although it is a labeled continue statement, it is simply jumping to the following line:
   
   ```c#
                       search3Continue: ;
   ```
   
   We will need that line to remain in place, though, because it has other `goto` statements referring to it.



##########
src/Lucene.Net/Support/IO/FileSupport.cs:
##########
@@ -192,7 +192,8 @@ public static FileInfo CreateTempFile(string prefix, string suffix, DirectoryInf
                 catch (IOException e) when (IsFileAlreadyExistsException(e, fileName))
                 {
                     // If the error was because the file exists, try again.
-                    continue;
+                    // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                    continue; //NOSONAR

Review Comment:
   `FileSupport` is not a direct port from Java, but a shim that we added to help support Lucene.NET. Since this is technically a file that we own (as are most of the files in Lucene.Net.Support), let's just remove the `continue` statement and not leave a comment (other than the original `// If the error was because the file exists, try again.` which describes the intent).



##########
src/Lucene.Net/Codecs/MultiLevelSkipListReader.cs:
##########
@@ -159,7 +159,8 @@ public virtual int SkipTo(int target)
                 {
                     if (!LoadNextSkip(level))
                     {
-                        continue;
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene.



##########
src/dotnet/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs:
##########
@@ -106,7 +106,8 @@ public override string ReadLine()
                     if (COMMENT_END.IsMatch(line))
                     {
                         inComment = false;
-                        continue; // Skip this line
+                        // LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
+                        continue; // Skip this line //NOSONAR

Review Comment:
   Please comment out this continue statement, it is not a labeled continue statement in Lucene. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org