onebeyond/onebeyond-studio-core

View on GitHub

Showing 368 of 368 total issues

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

    [Fact]
    public void TestDateTimeOffsetNullableDateOnOrBeforeProducesCorrectExpression()
    {
        var now = DateTimeOffset.UtcNow;
        var queryProperties = new Dictionary<string, IReadOnlyCollection<string>>
src/OneBeyond.Studio.Application.SharedKernel.Tests/Specifications/FilterExpressionBuilderTests.cs on lines 237..248

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 135.

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

        using (var serviceScope = ServiceProvider.CreateScope())
        {
            var vendorRWRepository = serviceScope.ServiceProvider
                .GetRequiredService<IRORepository<Vendor, Guid>>();

src/OneBeyond.Studio.DataAccess.EFCore.Tests/AggregateRootTests.cs on lines 74..90

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 134.

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

    private static EntityIntegrationEventList CollectIntegrationEvents(DbContext dbContext)
    {
        IEnumerable<(DomainEntity entity, IReadOnlyCollection<IntegrationEvent> integrationEvents)> raisedIntegrationEvents =
            dbContext.ChangeTracker.Entries<DomainEntity>()
                .Select(
src/OneBeyond.Studio.DataAccess.EFCore/DomainEvents/DomainEventsProcessor.cs on lines 111..126

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 134.

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

    private static EntityDomainEventList CollectDomainEvents(DbContext dbContext)
    {
        IEnumerable<(DomainEntity entity, IReadOnlyCollection<DomainEvent> domainEvents)> raisedDomainEvents =
            dbContext.ChangeTracker.Entries<DomainEntity>()
                .Select(
src/OneBeyond.Studio.DataAccess.EFCore/IntegrationEvents/IntegrationEventsProcessor.cs on lines 78..93

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 134.

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

        using (var serviceScope = ServiceProvider.CreateScope())
        {
            var vendorRWRepository = serviceScope.ServiceProvider
                .GetRequiredService<IRORepository<Vendor, Guid>>();

src/OneBeyond.Studio.DataAccess.EFCore.Tests/AggregateRootTests.cs on lines 123..139

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 134.

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 ProcessEventAsync has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private async Task<object> ProcessEventAsync(
        Audit.Core.AuditEvent auditEvent, 
        CancellationToken cancellationToken)
    {
        if (auditEvent is not AuditEventEntityFramework efAudit)

    Method BuildExpressionTest has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        [Fact]
        public void BuildExpressionTest()
        {
            var testGuid = Guid.NewGuid();
            var today = DateTime.Today.ToString();

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

      using System;
      using OneBeyond.Studio.Crosscuts.Exceptions;
      using OneBeyond.Studio.Domain.SharedKernel.Entities;
      
      namespace OneBeyond.Studio.Application.SharedKernel.Repositories.Exceptions;
      src/OneBeyond.Studio.Application.SharedKernel/Repositories/Exceptions/EntityNotFoundException.cs on lines 1..60

      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 132.

      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

      using System;
      using OneBeyond.Studio.Crosscuts.Exceptions;
      using OneBeyond.Studio.Domain.SharedKernel.Entities;
      
      namespace OneBeyond.Studio.Application.SharedKernel.Repositories.Exceptions;
      src/OneBeyond.Studio.Application.SharedKernel/Repositories/Exceptions/EntityAccessDeniedException.cs on lines 1..60

      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 132.

      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 RunAsync has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method GetRangeExpressionForDateTimeOffset has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static Expression GetRangeExpressionForDateTimeOffset(
                Expression propertyExpression,
                string[] dateTimeOffsetValuesAsString)
            {
                if (dateTimeOffsetValuesAsString.Length != 2)

          Method AddCollectionNavigationChanges has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void AddCollectionNavigationChanges(
                  IEnumerable<EventEntry> allChanges,
                  EventEntry currentEntry,
                  AuditEvent auditEventEntity,
                  CollectionEntry navigation)

            Method GetRangeExpressionForDateOnly has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static Expression GetRangeExpressionForDateOnly(
                    Expression propertyExpression,
                    string[] dateValuesAsString)
                {
                    if (dateValuesAsString.Length != 2)

              Method TestAnonymousTypeGetById has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  [TestMethod]
                  public async Task TestAnonymousTypeGetById()
                  {
                      var product1 = new Product("ring", "jewelery", "cartier", 999.99M, "france");
              
              
              Severity: Minor
              Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/AnonymousTypesTests.cs - About 1 hr to fix

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

                        public static MethodInfo[] MethodInfoList { get; } = new[]
                        {
                                Reflector.MethodFrom(
                                    (DbContext dbContext) => dbContext.SaveChanges()),
                                Reflector.MethodFrom(
                src/OneBeyond.Studio.DataAccess.EFCore/DomainEvents/DomainEventsProcessor.cs on lines 158..168

                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 128.

                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

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

                        public static MethodInfo[] MethodInfoList { get; } = new[]
                        {
                                Reflector.MethodFrom(
                                    (DbContext dbContext) => dbContext.SaveChanges()),
                                Reflector.MethodFrom(
                src/OneBeyond.Studio.DataAccess.EFCore/IntegrationEvents/IntegrationEventsProcessor.cs on lines 124..134

                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 128.

                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

                using EnsureThat;
                
                namespace OneBeyond.Studio.DataAccess.EFCore.Tests.Entities.AirTravels;
                
                internal sealed partial class Airline
                src/OneBeyond.Studio.DataAccess.EFCore.Tests/Entities/AirTravels/Airport.cs on lines 1..25

                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 128.

                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 sealed class Requirement2ViaSomething2Handler<TRequest>
                        : IAuthorizationRequirementHandler<TestableAuthorizationRequirements.Requirement2, TRequest>
                        where TRequest : TestableCommands.IRequestWithSomething2
                    {
                        private readonly Queue<string> _testableContainer;
                src/OneBeyond.Studio.Application.SharedKernel.Tests/Authorization/TestableAuthorizationRequirementHandlers.cs on lines 36..57

                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 128.

                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

                    [Fact]
                    public void TestDateOnOrBeforeProducesCorrectExpression()
                    {
                        var queryProperties = new Dictionary<string, IReadOnlyCollection<string>>
                            {
                src/OneBeyond.Studio.Application.SharedKernel.Tests/Specifications/FilterExpressionBuilderTests.cs on lines 185..195

                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 128.

                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

                using EnsureThat;
                
                namespace OneBeyond.Studio.DataAccess.EFCore.Tests.Entities.AirTravels;
                
                internal sealed partial class Airport
                src/OneBeyond.Studio.DataAccess.EFCore.Tests/Entities/AirTravels/Airline.cs on lines 1..25

                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 128.

                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

                Severity
                Category
                Status
                Source
                Language