uoyoCsharp/MiCake

View on GitHub

Showing 29 of 66 total issues

Class StringExtensions has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

    public static class StringExtensions
    {
        /// <summary>
        /// Adds a char to end of given string if it does not ends with the char.
        /// </summary>
Severity: Minor
Found in src/framework/MiCake.Core.Util/CommonTypes/StringExtensions.cs - About 3 hrs to fix

    Class SharedTypeExtensions has 26 methods (exceeds 20 allowed). Consider refactoring.
    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

      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

                public void ConfigureServices(IServiceCollection services)
                {
                    services.AddControllers(options =>
                    {
                    });
        Severity: Major
        Found in samples/BaseMiCakeApplication/Startup.cs - About 2 hrs to fix

          File StringExtensions.cs has 266 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using MiCake.Core.Util.Collections;
          using System;
          using System.Security.Cryptography;
          using System.Text;
          using System.Text.RegularExpressions;
          Severity: Minor
          Found in src/framework/MiCake.Core.Util/CommonTypes/StringExtensions.cs - About 2 hrs to fix

            Method BuildFilterValuesExpression has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            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

                      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

                        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

                                  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

                            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

                              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

                                private async Task<bool> VerifyCurrentUser(
                                    ParameterDescriptor parameterDescriptor,
                                    HttpContext httpContext,
                                    IDictionary<string, object> actionArguments)
                                {
                        Severity: Minor
                        Found in src/framework/MiCake.AspNetCore/Security/VerifyCurrentUserFilter.cs - About 1 hr to fix

                          Method Register has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          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

                                    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

                                      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

                                        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

                                          public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
                                          {
                                              if (!ActionDescriptorHelper.IsControllerActionDescriptor(context.ActionDescriptor))
                                              {
                                                  await next();
                                  Severity: Minor
                                  Found in src/framework/MiCake.AspNetCore/Uow/UnitOfWorkFilter.cs - About 1 hr to fix

                                    Method CreateNewUnitOfWork has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            private IUnitOfWork CreateNewUnitOfWork(UnitOfWorkOptions options)
                                            {
                                                IUnitOfWork result;
                                    
                                                //Give this scope to unit of work who will be created.
                                    Severity: Minor
                                    Found in src/framework/MiCake.Uow/Internal/UnitOfWorkManager.cs - About 1 hr to fix

                                      Method OpenTransactionAndGiveExecutorAsync has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              protected virtual async Task<ITransactionObject> OpenTransactionAndGiveExecutorAsync(
                                                  IEnumerable<ITransactionProvider> transactionProviders,
                                                  IDbExecutor dbExecutor,
                                                  CancellationToken cancellationToken)
                                              {
                                      Severity: Minor
                                      Found in src/framework/MiCake.Uow/Internal/UnitOfWork.cs - About 1 hr to fix

                                        Method CreateCustomModel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                protected virtual object CreateCustomModel(DataWrapperContext wrapperContext)
                                                {
                                                    var currentHttpCode = wrapperContext.HttpContext.Response.StatusCode;
                                        
                                                    if (_cacheCustomerType.TryGetValue(currentHttpCode, out var resultConfigInfo))
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language