Showing 29 of 66 total issues
Class StringExtensions
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public static class StringExtensions
{
/// <summary>
/// Adds a char to end of given string if it does not ends with the char.
/// </summary>
Class SharedTypeExtensions
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public static class SharedTypeExtensions
{
public static Type UnwrapNullableType(this Type type) => Nullable.GetUnderlyingType(type) ?? type;
public static bool IsNullableType(this Type type)
File SharedTypeExtensions.cs
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
Method ConfigureServices
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers(options =>
{
});
File StringExtensions.cs
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using MiCake.Core.Util.Collections;
using System;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
Method BuildFilterValuesExpression
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static Expression BuildFilterValuesExpression(Expression left, List<FilterValue> filterValues, FilterJoinType filterValueJoinType = FilterJoinType.Or)
{
Expression exp = null;
foreach (var filterValue in filterValues)
Method ConnectImplementationsToTypesClosing
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void ConnectImplementationsToTypesClosing(Type openRequestInterface,
IServiceCollection services,
IEnumerable<Assembly> assembliesToScan,
bool addIfAlreadyExists)
{
Method WrapSuccesfullysResult
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public virtual object WrapSuccesfullysResult(object orignalData, DataWrapperContext wrapperContext, bool isSoftException = false)
{
CheckValue.NotNull(wrapperContext, nameof(wrapperContext));
CheckValue.NotNull(wrapperContext.HttpContext, nameof(wrapperContext.HttpContext));
CheckValue.NotNull(wrapperContext.WrapperOptions, nameof(wrapperContext.WrapperOptions));
Consider simplifying this complex logical expression. Open
Open
if (genericDefinition == typeof(Tuple<>)
|| genericDefinition == typeof(Tuple<,>)
|| genericDefinition == typeof(Tuple<,,>)
|| genericDefinition == typeof(Tuple<,,,>)
|| genericDefinition == typeof(Tuple<,,,,>)
Method ConcatExpressionsWithOperator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static Expression ConcatExpressionsWithOperator(Expression left, Expression right, FilterOperatorType expressionOperator)
{
switch (expressionOperator)
{
case FilterOperatorType.Equal:
Method UpdateRefreshTokenAsync
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public virtual async Task<string> UpdateRefreshTokenAsync(string handle, RefreshToken refreshToken, CancellationToken cancellationToken = default)
{
bool needsCreate = false;
bool needsUpdate = false;
Method VerifyCurrentUser
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task<bool> VerifyCurrentUser(
ParameterDescriptor parameterDescriptor,
HttpContext httpContext,
IDictionary<string, object> actionArguments)
{
Method Register
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public virtual void Register(IMiCakeModuleCollection miCakeModules)
{
var injectServices = new List<InjectServiceInfo>();
//filter need register modules
Method AddInjectServices
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override List<InjectServiceInfo> AddInjectServices(Type currentType)
{
List<InjectServiceInfo> result = new();
//add attribute mark services
Method Filter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static IQueryable<T> Filter<T>(this IQueryable<T> query, FilterGroupsHolder filterGroupsHolder)
{
if (filterGroupsHolder.FilterGroups.Count == 0)
{
return query;
Method GetPropertyAccess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static PropertyInfo GetPropertyAccess(this LambdaExpression propertyAccessExpression)
{
var parameterExpression = propertyAccessExpression.Parameters.Single();
var propertyInfo = parameterExpression.MatchSimplePropertyAccess(propertyAccessExpression.Body);
Method OnActionExecutionAsync
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
if (!ActionDescriptorHelper.IsControllerActionDescriptor(context.ActionDescriptor))
{
await next();
Method CreateNewUnitOfWork
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private IUnitOfWork CreateNewUnitOfWork(UnitOfWorkOptions options)
{
IUnitOfWork result;
//Give this scope to unit of work who will be created.
Method OpenTransactionAndGiveExecutorAsync
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected virtual async Task<ITransactionObject> OpenTransactionAndGiveExecutorAsync(
IEnumerable<ITransactionProvider> transactionProviders,
IDbExecutor dbExecutor,
CancellationToken cancellationToken)
{
Method CreateCustomModel
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected virtual object CreateCustomModel(DataWrapperContext wrapperContext)
{
var currentHttpCode = wrapperContext.HttpContext.Response.StatusCode;
if (_cacheCustomerType.TryGetValue(currentHttpCode, out var resultConfigInfo))