onebeyond/onebeyond-studio-core

View on GitHub

Showing 368 of 368 total issues

Method Throws_when_override_scope_disposing_is_broken has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    [TestMethod]
    public void Throws_when_override_scope_disposing_is_broken()
    {
        // Arrange
        var containerBuilder = new ContainerBuilder();

    Method AddAuthorizationRequirementHandlers has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static ContainerBuilder AddAuthorizationRequirementHandlers(
            this ContainerBuilder containerBuilder,
            AuthorizationOptions authorizationOptions,
            params Assembly[] handlerAssemblies)
        {

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public async Task CreateAsync(TAggregateRoot aggregateRoot, CancellationToken cancellationToken)
          {
              EnsureArg.IsNotNull(aggregateRoot, nameof(aggregateRoot));
              var ensureCreateDataAccessPolicy = await EnsureCreateDataAccessPolicy.Task.ConfigureAwait(false);
              ensureCreateDataAccessPolicy(aggregateRoot);
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 108..115
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 117..124

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public async Task UpdateAsync(TAggregateRoot aggregateRoot, CancellationToken cancellationToken)
          {
              EnsureArg.IsNotNull(aggregateRoot, nameof(aggregateRoot));
              var ensureUpdateDataAccessPolicy = await EnsureUpdateDataAccessPolicy.Task.ConfigureAwait(false);
              ensureUpdateDataAccessPolicy(aggregateRoot);
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 99..106
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 117..124

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public async Task DeleteAsync(TAggregateRoot aggregateRoot, CancellationToken cancellationToken)
          {
              EnsureArg.IsNotNull(aggregateRoot, nameof(aggregateRoot));
              var ensureDeleteDataAccessPolicy = await EnsureDeleteDataAccessPolicy.Task.ConfigureAwait(false);
              ensureDeleteDataAccessPolicy(aggregateRoot);
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 99..106
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 108..115

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              if (!numericValuesAsString[1].IsNullOrWhiteSpace())
              {
                  lteNumeric = Convert.ChangeType(
                          numericValuesAsString[1],
                          Nullable.GetUnderlyingType(propertyExpression.Type) ?? propertyExpression.Type)
      src/OneBeyond.Studio.Application.SharedKernel/Specifications/FilterExpressionBuilder.cs on lines 446..454

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              if (!numericValuesAsString[0].IsNullOrWhiteSpace())
              {
                  gteNumeric = Convert.ChangeType(
                          numericValuesAsString[0],
                          Nullable.GetUnderlyingType(propertyExpression.Type) ?? propertyExpression.Type)
      src/OneBeyond.Studio.Application.SharedKernel/Specifications/FilterExpressionBuilder.cs on lines 457..465

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 109.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method EvaluateFilterItems has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static List<Expression> EvaluateFilterItems(
              IReadOnlyCollection<FilterItem> filterItems,
              ParameterExpression parameterExpression)
          {
              var expressions = new List<Expression>(filterItems.Count);

        Method TestAggregateRootUpdateMultipleEntitiesWithValidation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            [TestMethod]
            public async Task TestAggregateRootUpdateMultipleEntitiesWithValidation()
            {
                var vendorVasyaId = default(Guid);
                var vendorPetyaId = default(Guid);
        Severity: Minor
        Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/AggregateRootTests.cs - About 1 hr to fix

          Method TestRequirementHandlingSucceedsWhenHandlerDependsOnCommand has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              [TestMethod]
              public async Task TestRequirementHandlingSucceedsWhenHandlerDependsOnCommand()
              {
                  using (var serviceScope = ServiceProvider.CreateScope())
                  {

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public static Task<bool> AnyAsync<TEntity, TEntityId, TResultDto>(
                    this IRORepository<TEntity, TEntityId> roRepository,
                    Expression<Func<TResultDto, bool>>? filter = default,
                    CancellationToken cancellationToken = default)
                    where TEntity : DomainEntity<TEntityId>
            src/OneBeyond.Studio.Application.SharedKernel/Repositories/IRORepositoryExtensions.cs on lines 48..61

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 105.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public static Task<int> CountAsync<TEntity, TEntityId, TResultDto>(
                    this IRORepository<TEntity, TEntityId> roRepository,
                    Expression<Func<TResultDto, bool>>? filter = default,
                    CancellationToken cancellationToken = default)
                    where TEntity : DomainEntity<TEntityId>
            src/OneBeyond.Studio.Application.SharedKernel/Repositories/IRORepositoryExtensions.cs on lines 63..76

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 105.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method AddManyToManyNavigationChanges has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void AddManyToManyNavigationChanges(
                    IEnumerable<EventEntry> allChanges,
                    AuditEvent auditEventEntity,
                    CollectionEntry navigation,
                    string navigationName,

              Method Returns_context_based_on_override_scope has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  [TestMethod]
                  public void Returns_context_based_on_override_scope()
                  {
                      // Arrange
                      var containerBuilder = new ContainerBuilder();

                Method ExecuteAsync has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected async override Task ExecuteAsync(CancellationToken stoppingToken)
                    {
                        Logger.LogInformation(
                            "Start relaying domain events from {RaisedDomainEventReceiverCount} domain event receiver(s)",
                            _raisedDomainEventReceivers.Count);
                Severity: Minor
                Found in src/OneBeyond.Studio.Hosting/DomainEvents/DomainEventRelayBase.cs - About 1 hr to fix

                  Method RunAsync has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public Task RunAsync(
                          Func<IntegrationEvent, CancellationToken, Task> processAsync,
                          CancellationToken cancellationToken)
                      {
                          EnsureArg.IsNotNull(processAsync, nameof(processAsync));

                    Method GetRangeExpression has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static Expression GetRangeExpression(
                            Expression valueExpresion,
                            Expression? gteValueExpression,
                            Expression? lteValueExpression)
                        {

                      Method AddMediatorRequestHandlers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static ContainerBuilder AddMediatorRequestHandlers(
                              this ContainerBuilder containerBuilder,
                              params Assembly[] requestHandlersAssemblies)
                          {
                              EnsureArg.IsNotNull(containerBuilder, nameof(containerBuilder));

                        Method Handle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public virtual async Task<PagedList<TResultDto>> Handle(
                                TQuery query,
                                CancellationToken cancellationToken)
                            {
                                EnsureArg.IsNotNull(query, nameof(query));

                          Method TestIncludesTraitsWhereClauseDetection has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              [TestMethod]
                              public void TestIncludesTraitsWhereClauseDetection()
                              {
                                  var includes = new Includes<PurchaseOrder>()
                                      .Include((purchaseOrder) => purchaseOrder.Lines)
                            Severity
                            Category
                            Status
                            Source
                            Language