onebeyond/onebeyond-studio-core

View on GitHub

Showing 368 of 368 total issues

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

using System;
using System.Threading;
using System.Threading.Tasks;
using Azure.Identity;
using Azure.Storage.Queues;
Severity: Major
Found in src/OneBeyond.Studio.Infrastructure.Azure/Storage/Queue.cs and 1 other location - About 4 hrs to fix
src/OneBeyond.Studio.Infrastructure.Azure/Storage/BlobContainer.cs on lines 1..49

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

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

File EFPlusIncludes.cs has 346 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
Severity: Minor
Found in src/OneBeyond.Studio.DataAccess.EFCore/Repositories/EFPlusIncludes.cs - About 4 hrs to fix

    Method TestFilteredIncludeLoadsOnlyRequestedChildren has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        [TestMethod]
        public async Task TestFilteredIncludeLoadsOnlyRequestedChildren()
        {
            var purchaseOrderId = default(Guid);
    
    
    Severity: Major
    Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs - About 4 hrs to fix

      Method TestFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          [TestMethod]
          public async Task TestFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren()
          {
              var vendorId = default(Guid);
      
      
      Severity: Major
      Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs - About 4 hrs to fix

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

            [TestMethod]
            public async Task TestPolicyRequirementsAreHandledByOrLogicAndPolicyFailsWhenBothRequirementsFail()
            {
                using (var serviceScope = ServiceProvider.CreateScope())
                {
        src/OneBeyond.Studio.Application.SharedKernel.Tests/Authorization/AuthorizationRequirementHandlerTests.cs on lines 235..265

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

        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

            [TestMethod]
            public async Task TestPoliciesAreHandledByAndLogicAndEntireCheckFailsWhenFirstPolicySucceedsWhileSecondOneFails()
            {
                using (var serviceScope = ServiceProvider.CreateScope())
                {
        src/OneBeyond.Studio.Application.SharedKernel.Tests/Authorization/AuthorizationRequirementHandlerTests.cs on lines 145..175

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

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

            [TestMethod]
            public async Task TestEFStyleFilteredIncludeWithSingleEntityPathLoadsOnlyRequestedChildren()
            {
                var vendorId = default(Guid);
        
        
        Severity: Major
        Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs - About 4 hrs to fix

          Method TestEFStyleFilteredIncludeLoadsOnlyRequestedChildren has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              [TestMethod]
              public async Task TestEFStyleFilteredIncludeLoadsOnlyRequestedChildren()
              {
                  var purchaseOrderId = default(Guid);
          
          
          Severity: Major
          Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs - About 4 hrs to fix

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

            using System;
            using System.Threading;
            using System.Threading.Tasks;
            using EnsureThat;
            using OneBeyond.Studio.Application.SharedKernel.IntegrationEvents;
            src/OneBeyond.Studio.Application.SharedKernel.Tests/IntegrationEvents/TestableIntegrationEventHandler2.cs on lines 1..44

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

            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 System.Threading;
            using System.Threading.Tasks;
            using EnsureThat;
            using OneBeyond.Studio.Application.SharedKernel.IntegrationEvents;
            src/OneBeyond.Studio.Application.SharedKernel.Tests/IntegrationEvents/TestableIntegrationEventHandler1.cs on lines 1..44

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

            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 TestAnonymousList has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            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");
            Severity: Major
            Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/AnonymousTypesTests.cs - About 3 hrs to fix

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

                      using (var serviceScope = ServiceProvider.CreateScope())
                      {
                          var purchaseOrderRWRepository = serviceScope.ServiceProvider
                              .GetRequiredService<IRWRepository<PurchaseOrder, Guid>>();
              
              
              src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 203..221

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

              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

                      using (var serviceScope = ServiceProvider.CreateScope())
                      {
                          var purchaseOrderRWRepository = serviceScope.ServiceProvider
                              .GetRequiredService<IRWRepository<PurchaseOrder, Guid>>();
              
              
              src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 656..674

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

              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

                  [TestMethod]
                  public async Task RouteValuesOverrideBody()
                  {
                      var context = new TestBindingContext(
                          new MixedSourceBinderSource(new string[] { Source.BODY, Source.ROUTE }),
              src/OneBeyond.Studio.Hosting.AspNet.Tests/ModelBinders/MixedSource/MixedSourceBinderTests.cs on lines 29..44

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

              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

                  [TestMethod]
                  public async Task BodyValuesOverrideRoute()
                  {
                      var context = new TestBindingContext(new MixedSourceBinderSource(
                          new string[] { Source.ROUTE, Source.BODY }),
              src/OneBeyond.Studio.Hosting.AspNet.Tests/ModelBinders/MixedSource/MixedSourceBinderTests.cs on lines 46..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 231.

              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

              File BaseRORepository.cs has 306 lines of code (exceeds 250 allowed). Consider refactoring.
              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

                    [TestMethod]
                    public async Task TestTPTLikeHierarchy()
                    {
                        var baAirlineId = default(Guid);
                        var lhAirlineId = default(Guid);
                Severity: Major
                Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/DesignIdeasTests.cs - About 3 hrs to fix

                  Method TestDomainEventHandlersAreCalledAndDomainEventsAreQueued has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      [TestMethod]
                      public async Task TestDomainEventHandlersAreCalledAndDomainEventsAreQueued()
                      {
                          var purchaseOrderId = default(Guid);
                  
                  
                  Severity: Major
                  Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/DomainEventsTests.cs - About 3 hrs to fix

                    Method TryConvertFromString has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static bool TryConvertFromString(string valueToken, Type type, out object? value)
                        {
                            valueToken = TrimEqualsFunction(valueToken);
                            try
                            {

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

                              using (var serviceScope = ServiceProvider.CreateScope())
                              {
                                  var serviceProvider = serviceScope.ServiceProvider;
                                  var testableContainer = serviceProvider.GetRequiredService<Queue<string>>();
                                  var mediator = serviceProvider.GetRequiredService<IMediator>();
                      src/OneBeyond.Studio.Application.SharedKernel.Tests/Authorization/AuthorizationRequirementHandlerTests.cs on lines 22..41
                      src/OneBeyond.Studio.Application.SharedKernel.Tests/Authorization/AuthorizationRequirementHandlerTests.cs on lines 68..87

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

                      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