Showing 90 of 368 total issues
File FilteredIncludesTests.cs
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
File FilterExpressionBuilder.cs
has 697 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
File FilterExpressionBuilderTests.cs
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Ardalis.SmartEnum;
File AuditDataProvider.cs
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Method TestFilteredIncludeWithMultiplePathsLoadsOnlyRequestedChildren
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestFilteredIncludeWithMultiplePathsLoadsOnlyRequestedChildren()
{
var purchaseOrderId = default(Guid);
Method TestEFStyleFilteredIncludeWithMultiplePathsLoadsOnlyRequestedChildren
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestEFStyleFilteredIncludeWithMultiplePathsLoadsOnlyRequestedChildren()
{
var purchaseOrderId = default(Guid);
Class FilterExpressionBuilderTests
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public sealed class FilterExpressionBuilderTests : IClassFixture<LogManagerFixture>
{
private enum TestEnum
{
TestValue = 1
File EFPlusIncludes.cs
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
Method TestFilteredIncludeLoadsOnlyRequestedChildren
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestFilteredIncludeLoadsOnlyRequestedChildren()
{
var purchaseOrderId = default(Guid);
Method TestFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren()
{
var vendorId = default(Guid);
Method TestEFStyleFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestEFStyleFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren()
{
var vendorId = default(Guid);
Method TestEFStyleFilteredIncludeLoadsOnlyRequestedChildren
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestEFStyleFilteredIncludeLoadsOnlyRequestedChildren()
{
var purchaseOrderId = default(Guid);
Method TestAnonymousList
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestAnonymousList()
{
var product1 = new Product("ring", "jewelery", "cartier", 999.99M, "france");
var product2 = new Product("ring", "jewelery", "tiffany", 1999.99M, "us");
File BaseRORepository.cs
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
Method TestTPTLikeHierarchy
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestTPTLikeHierarchy()
{
var baAirlineId = default(Guid);
var lhAirlineId = default(Guid);
Method TestDomainEventHandlersAreCalledAndDomainEventsAreQueued
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[TestMethod]
public async Task TestDomainEventHandlersAreCalledAndDomainEventsAreQueued()
{
var purchaseOrderId = default(Guid);
Method TryConvertFromString
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static bool TryConvertFromString(string valueToken, Type type, out object? value)
{
valueToken = TrimEqualsFunction(valueToken);
try
{
Method Handle
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<TResponse> Handle(
TRequest request,
RequestHandlerDelegate<TResponse> next,
CancellationToken cancellationToken)
{
Class FileValidatorBuilder
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public sealed class FileValidatorBuilder
{
private readonly Dictionary<string, IFileContentValidator> _validators = new();
private int? _maxFileSizeInBytes = null;
Method TryConvertFromString
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
Open
private static bool TryConvertFromString(string valueToken, Type type, out object? value)
{
valueToken = TrimEqualsFunction(valueToken);
try
{
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"