Skip to content

Commit 12f1e98

Browse files
committed
Bunch of quality suggestions from Rider
1 parent 997f2bd commit 12f1e98

File tree

178 files changed

+1050
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+1050
-1052
lines changed

RDFSharp/Model/RDFCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System.Collections;
1918
using System.Collections.Generic;
19+
using RDFSharp.Query;
2020

2121
namespace RDFSharp.Model
2222
{

RDFSharp/Model/RDFContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System.Collections;
1918
using System.Collections.Generic;
19+
using RDFSharp.Query;
2020

2121
namespace RDFSharp.Model
2222
{

RDFSharp/Model/RDFGraph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System;
1918
using System.Collections;
2019
using System.Collections.Generic;
2120
using System.Data;
2221
using System.IO;
2322
using System.Net;
2423
using System.Threading.Tasks;
24+
using RDFSharp.Query;
2525

2626
namespace RDFSharp.Model
2727
{

RDFSharp/Model/RDFModelUtilities.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ internal static (bool,string) ValidateTypedLiteral(string literalValue, RDFModel
599599
case RDFModelEnums.RDFDatatypes.RDF_XMLLITERAL:
600600
try
601601
{
602-
XDocument.Parse(literalValue);
602+
_ = XDocument.Parse(literalValue);
603603
return (true, literalValue);
604604
}
605605
catch { return (false, literalValue); }
@@ -610,9 +610,8 @@ internal static (bool,string) ValidateTypedLiteral(string literalValue, RDFModel
610610
return (isValidJson, literalValue);
611611

612612
case RDFModelEnums.RDFDatatypes.XSD_ANYURI:
613-
if (Uri.TryCreate(literalValue, UriKind.Absolute, out Uri outUri))
614-
return (true, Convert.ToString(outUri));
615-
return (false, literalValue);;
613+
return Uri.TryCreate(literalValue, UriKind.Absolute, out Uri outUri) ? (true, Convert.ToString(outUri))
614+
: (false, literalValue);
616615

617616
case RDFModelEnums.RDFDatatypes.XSD_NAME:
618617
try
@@ -683,14 +682,13 @@ internal static (bool,string) ValidateTypedLiteral(string literalValue, RDFModel
683682
case RDFModelEnums.RDFDatatypes.XSD_BASE64BINARY:
684683
try
685684
{
686-
Convert.FromBase64String(literalValue);
685+
_ = Convert.FromBase64String(literalValue);
687686
return (true, literalValue);
688687
}
689688
catch { return (false, literalValue); }
690689

691690
case RDFModelEnums.RDFDatatypes.XSD_HEXBINARY:
692-
bool isValidHexBinary = hexBinary.Value.Match(literalValue).Success;
693-
return (isValidHexBinary, literalValue);
691+
return (hexBinary.Value.Match(literalValue).Success, literalValue);
694692
#endregion
695693

696694
#region GEOGRAPHIC CATEGORY

RDFSharp/Model/RDFNamespace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace RDFSharp.Model
2222
/// <summary>
2323
/// RDFNamespace represents a generic namespace in the RDF model.
2424
/// </summary>
25-
public class RDFNamespace : IEquatable<RDFNamespace>
25+
public sealed class RDFNamespace : IEquatable<RDFNamespace>
2626
{
2727
#region Properties
2828
/// <summary>

RDFSharp/Model/RDFPlainLiteral.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17+
using System;
1718
using System.Text.RegularExpressions;
1819

1920
namespace RDFSharp.Model
@@ -82,8 +83,8 @@ public bool HasLanguage()
8283
/// </summary>
8384
public bool HasDirection()
8485
=> HasLanguage()
85-
&& (Language.EndsWith("--ltr", System.StringComparison.OrdinalIgnoreCase)
86-
|| Language.EndsWith("--rtl", System.StringComparison.OrdinalIgnoreCase));
86+
&& (Language.EndsWith("--ltr", StringComparison.OrdinalIgnoreCase)
87+
|| Language.EndsWith("--rtl", StringComparison.OrdinalIgnoreCase));
8788
#endregion
8889
}
8990
}

RDFSharp/Model/RDFResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System;
1918
using System.Collections.Generic;
19+
using RDFSharp.Query;
2020

2121
namespace RDFSharp.Model
2222
{

RDFSharp/Model/RDFTriple.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System;
1918
using System.Threading.Tasks;
19+
using RDFSharp.Query;
2020

2121
namespace RDFSharp.Model
2222
{

RDFSharp/Model/Serializers/RDFTurtle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
*/
1616

17-
using RDFSharp.Query;
1817
using System;
1918
using System.Collections.Generic;
2019
using System.Globalization;
2120
using System.IO;
2221
using System.Linq;
2322
using System.Text;
2423
using System.Text.RegularExpressions;
24+
using RDFSharp.Query;
2525

2626
namespace RDFSharp.Model
2727
{

RDFSharp/Model/Serializers/RDFXml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ internal static void Serialize(RDFGraph graph, Stream outputStream)
207207
.TrimEnd(':', '/');
208208
try
209209
{
210-
new RDFTypedLiteral(predUri, RDFModelEnums.RDFDatatypes.XSD_QNAME);
210+
_ = new RDFTypedLiteral(predUri, RDFModelEnums.RDFDatatypes.XSD_QNAME);
211211
}
212212
catch
213213
{

0 commit comments

Comments
 (0)