Skip to content

Commit

Permalink
changes made for Redundant jump statements apache#684
Browse files Browse the repository at this point in the history
  • Loading branch information
sachdevlaksh committed Oct 27, 2022
1 parent e281a0d commit 6c8e624
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,8 @@ private void Step4()
if (Suffix(RV, "o"))
{
CT = RemoveSuffix(CT, "o");
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

}
Expand Down Expand Up @@ -1376,7 +1377,8 @@ private void Step5()
}

CT = RemoveSuffix(CT, "e");
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
}

Expand Down
48 changes: 32 additions & 16 deletions src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ private void Plural()
{
Lookup();
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
else
{
Expand Down Expand Up @@ -872,7 +873,8 @@ private void PastTense()
word.UnsafeWrite('e');
k = j + 1;
// nolookup() - we already tried the "e" ending
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
}

Expand Down Expand Up @@ -990,7 +992,8 @@ private void Aspect()
word.UnsafeWrite('e');
k = j + 1;
// nolookup(); we already tried an 'e' ending
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
}

Expand Down Expand Up @@ -1068,7 +1071,8 @@ private void ItyEndings()
word.Length = j + 1;
k = j;
// nolookup(), we already did it.
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
}

Expand Down Expand Up @@ -1106,7 +1110,8 @@ private void NceEndings()
k = old_k;
// nolookup() because we restored the original ending
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>handle -ness</summary>
Expand All @@ -1126,7 +1131,8 @@ private void NessEndings()
}
Lookup();
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>handle -ism</summary>
Expand All @@ -1142,7 +1148,8 @@ private void IsmEndings()
k = j;
Lookup();
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>this routine deals with -ment endings.</summary>
Expand All @@ -1162,7 +1169,8 @@ private void MentEndings()
k = old_k;
// nolookup
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>this routine deals with -ize endings.</summary>
Expand Down Expand Up @@ -1203,7 +1211,8 @@ private void IzeEndings()
k = old_k;
// nolookup()
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>handle -ency and -ancy</summary>
Expand All @@ -1229,7 +1238,8 @@ private void NcyEndings()
k = j + 3;
Lookup();
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>handle -able and -ible</summary>
Expand Down Expand Up @@ -1283,7 +1293,8 @@ private void BleEndings()
k = old_k;
// nolookup()
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>
Expand Down Expand Up @@ -1327,7 +1338,8 @@ private void IcEndings()
k = j + 2;
// nolookup()
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

private static char[] ization = "ization".ToCharArray();
Expand Down Expand Up @@ -1473,7 +1485,8 @@ private void IonEndings()
}

// nolookup(); all of the other paths restored original values
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>
Expand Down Expand Up @@ -1647,7 +1660,8 @@ private void LyEndings()
k = j;
// nolookup()... we already tried removing the "ly" variant
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>
Expand Down Expand Up @@ -1744,7 +1758,8 @@ private void AlEndings()
}

}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

/// <summary>
Expand Down Expand Up @@ -1804,7 +1819,8 @@ private void IveEndings()
k = old_k;
// nolookup()
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}

internal KStemmer()
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net.Analysis.Common/Analysis/Nl/DutchStemmer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ private void Step3b(StringBuilder sb)
{
sb.Remove(index, index + 3 - index);
}
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Codecs/BlockTreeTermsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
else if (cmp == 0)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Codecs/Compressing/CompressionMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public override void Compress(byte[] bytes, int off, int len, DataOutput output)
{
if (Debugging.AssertsEnabled) Debugging.Assert(len == 0, "{0}", len);
output.WriteVInt32(0);
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Codecs/Compressing/LZ4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
search3Continue: ;
}
//search3Break: ; // LUCENENET NOTE: Unreachable
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Codecs/MultiLevelSkipListReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
else
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Support/IO/FileSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
return new FileInfo(fileName);
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net/Util/Automaton/UTF32ToUTF8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ private void Build(State start, State end, UTF8Sequence startUTF8, UTF8Sequence
{
// Super degen: just single edge, one UTF8 byte:
start.AddTransition(new Transition(startUTF8.ByteAt(upto), endUTF8.ByteAt(upto), end));
return;
// LUCENENET: Redundant jump statements. https://sonarcloud.io/project/issues?resolved=false&rules=csharpsquid%3AS3626&id=nikcio_lucenenet
//return;
}
else
{
Expand Down
6 changes: 4 additions & 2 deletions src/Lucene.Net/Util/Fst/FSTEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
else if (low == arc.NumArcs)
{
Expand Down Expand Up @@ -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
}
else if (high == -1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
else
Expand Down

0 comments on commit 6c8e624

Please sign in to comment.