onebeyond/onebeyond-studio-core

View on GitHub

Showing 368 of 368 total issues

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

using System;
using OneBeyond.Studio.Crosscuts.Exceptions;

namespace OneBeyond.Studio.Crosscuts.Utilities.FileUploadValidators;

src/OneBeyond.Studio.Application.SharedKernel/Exceptions/AuthorizationException.cs on lines 1..35
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/IntegrationEventException.cs on lines 1..26
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/ValidationException.cs on lines 1..33
src/OneBeyond.Studio.Crosscuts/Utilities/FileUploadValidators/FileContentValidatorException.cs on lines 1..36

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

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

    internal Includes(Includes<TEntity> previous, Expression<Func<TChild, IEnumerable<TNextChild>>> navigation)
        : base(previous)
    {
        EnsureArg.IsNotNull(navigation, nameof(navigation));

src/OneBeyond.Studio.Application.SharedKernel/Specifications/Includes.cs on lines 155..162

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

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 5 locations. Consider refactoring.
Open

using System;
using OneBeyond.Studio.Crosscuts.Exceptions;

namespace OneBeyond.Studio.Application.SharedKernel.Exceptions;

src/OneBeyond.Studio.Application.SharedKernel/Exceptions/AuthorizationException.cs on lines 1..35
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/ValidationException.cs on lines 1..33
src/OneBeyond.Studio.Crosscuts/Utilities/FileUploadValidators/FileContentValidatorException.cs on lines 1..36
src/OneBeyond.Studio.Crosscuts/Utilities/FileUploadValidators/FileSizeValidatorException.cs on lines 1..35

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

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 5 locations. Consider refactoring.
Open

using System;
using System.Runtime.Serialization;
using OneBeyond.Studio.Crosscuts.Exceptions;

namespace OneBeyond.Studio.Crosscuts.Utilities.FileUploadValidators;
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/AuthorizationException.cs on lines 1..35
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/IntegrationEventException.cs on lines 1..26
src/OneBeyond.Studio.Application.SharedKernel/Exceptions/ValidationException.cs on lines 1..33
src/OneBeyond.Studio.Crosscuts/Utilities/FileUploadValidators/FileSizeValidatorException.cs on lines 1..35

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

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 5 locations. Consider refactoring.
Open

    public AuditingBuilder(
        IServiceCollection services,
        IConfiguration configuration)
    {
        EnsureArg.IsNotNull(services, nameof(services));
src/OneBeyond.Studio.Application.SharedKernel/Authorization/AuthorizationRequirementBehavior.cs on lines 26..35
src/OneBeyond.Studio.DataAccess.EFCore/Projections/ProjectionContext.cs on lines 9..18
src/OneBeyond.Studio.Hosting.AspNet/ModelBinders/MixedSource/MixedSourceBinderProvider.cs on lines 11..20
src/OneBeyond.Studio.Hosting/IntegrationEvents/IntegrationEventRelay.cs on lines 23..32

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

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 5 locations. Consider refactoring.
Open

    internal ProjectionContext(
        DbContext dbContext,
        IConfigurationProvider mapperConfigurationProvider)
    {
        EnsureArg.IsNotNull(dbContext, nameof(dbContext));
src/OneBeyond.Studio.Application.SharedKernel/Authorization/AuthorizationRequirementBehavior.cs on lines 26..35
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/DependencyInjection/AuditingBuilder.cs on lines 9..18
src/OneBeyond.Studio.Hosting.AspNet/ModelBinders/MixedSource/MixedSourceBinderProvider.cs on lines 11..20
src/OneBeyond.Studio.Hosting/IntegrationEvents/IntegrationEventRelay.cs on lines 23..32

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

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 5 locations. Consider refactoring.
Open

    public MixedSourceBinderProvider(
        BindingSource bindingSource,
        IModelBinder modelBinder)
    {
        EnsureArg.IsNotNull(bindingSource, nameof(bindingSource));
src/OneBeyond.Studio.Application.SharedKernel/Authorization/AuthorizationRequirementBehavior.cs on lines 26..35
src/OneBeyond.Studio.DataAccess.EFCore/Projections/ProjectionContext.cs on lines 9..18
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/DependencyInjection/AuditingBuilder.cs on lines 9..18
src/OneBeyond.Studio.Hosting/IntegrationEvents/IntegrationEventRelay.cs on lines 23..32

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

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 5 locations. Consider refactoring.
Open

    public AuthorizationRequirementBehavior(
        ILifetimeScope container,
        AuthorizationOptions authorizationOptions)
    {
        EnsureArg.IsNotNull(container, nameof(container));
src/OneBeyond.Studio.DataAccess.EFCore/Projections/ProjectionContext.cs on lines 9..18
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/DependencyInjection/AuditingBuilder.cs on lines 9..18
src/OneBeyond.Studio.Hosting.AspNet/ModelBinders/MixedSource/MixedSourceBinderProvider.cs on lines 11..20
src/OneBeyond.Studio.Hosting/IntegrationEvents/IntegrationEventRelay.cs on lines 23..32

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

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 5 locations. Consider refactoring.
Open

    public IntegrationEventRelay(
        IIntegrationEventReceiver integrationEventReceiver,
        IIntegrationEventDispatcher integrationEventDispatcher)
    {
        EnsureArg.IsNotNull(integrationEventReceiver, nameof(integrationEventReceiver));
src/OneBeyond.Studio.Application.SharedKernel/Authorization/AuthorizationRequirementBehavior.cs on lines 26..35
src/OneBeyond.Studio.DataAccess.EFCore/Projections/ProjectionContext.cs on lines 9..18
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/DependencyInjection/AuditingBuilder.cs on lines 9..18
src/OneBeyond.Studio.Hosting.AspNet/ModelBinders/MixedSource/MixedSourceBinderProvider.cs on lines 11..20

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

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 SaveChangesCallIntegration? InterceptSaveChangesCall(IExecution execution)
    {
        return SaveChangesCallIntegration.MethodInfoList.Any(
                (methodInfo) =>
                    methodInfo.Equals(execution.Method.GetBaseDefinition())) // SaveChanges can be overriden by a derived class
src/OneBeyond.Studio.DataAccess.EFCore/DomainEvents/DomainEventsProcessor.cs on lines 128..135

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

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 SaveChangesCall? InterceptSaveChangesCall(IExecution execution)
    {
        return SaveChangesCall.MethodInfoList.Any(
                (methodInfo) =>
                    methodInfo.Equals(execution.Method.GetBaseDefinition())) // SaveChanges can be overriden by a derived class
src/OneBeyond.Studio.DataAccess.EFCore/IntegrationEvents/IntegrationEventsProcessor.cs on lines 95..102

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

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

using System;

namespace OneBeyond.Studio.Crosscuts.Exceptions;

/// <summary>
src/OneBeyond.Studio.Crosscuts/Exceptions/OneBeyondException.cs on lines 1..32
src/OneBeyond.Studio.Crosscuts/Exceptions/OptionsException.cs on lines 1..34

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

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

using System;

namespace OneBeyond.Studio.Crosscuts.Exceptions;

[Serializable]
src/OneBeyond.Studio.Crosscuts/Exceptions/ExpressionException.cs on lines 1..25
src/OneBeyond.Studio.Crosscuts/Exceptions/OptionsException.cs on lines 1..34

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

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

using System;

namespace OneBeyond.Studio.Crosscuts.Exceptions;

/// <summary>
Severity: Minor
Found in src/OneBeyond.Studio.Crosscuts/Exceptions/OptionsException.cs and 2 other locations - About 40 mins to fix
src/OneBeyond.Studio.Crosscuts/Exceptions/ExpressionException.cs on lines 1..25
src/OneBeyond.Studio.Crosscuts/Exceptions/OneBeyondException.cs on lines 1..32

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

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 ReadJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public override TEnum ReadJson(JsonReader reader, Type objectType, TEnum existingValue, bool hasExistingValue, JsonSerializer serializer)

    Method ListAsync has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Expression<Func<TEntity, TResultDto>> projection,
            Expression<Func<TEntity, bool>>? filter = null,
            Paging? paging = null,
            IReadOnlyCollection<Sorting<TEntity>>? sortings = null,
            CancellationToken cancellationToken = default)
    Severity: Minor
    Found in src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRORepository.cs - About 35 mins to fix

      Method ReadJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public override TEnum ReadJson(JsonReader reader, Type objectType, TEnum? existingValue, bool hasExistingValue, JsonSerializer serializer)

        Method ListAsync has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                Expression<Func<TEntity, TResultDto>> projection,
                Expression<Func<TEntity, bool>>? filter = default,
                Paging? paging = default,
                IReadOnlyCollection<Sorting<TEntity>>? sortings = default,
                CancellationToken cancellationToken = default);

          Method ReadJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  JsonReader reader,
                  Type objectType,
                  TimeZoneInfo? existingValue,
                  bool hasExistingValue,
                  JsonSerializer serializer)
          Severity: Minor
          Found in src/OneBeyond.Studio.Crosscuts/Json/IanaTimeZoneInfoJsonConverter.cs - About 35 mins to fix

            Method ListAsync has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    Expression<Func<TEntity, bool>>? filter = default,
                    Includes<TEntity>? includes = default,
                    Paging? paging = default,
                    IReadOnlyCollection<Sorting<TEntity>>? sortings = default,
                    CancellationToken cancellationToken = default);
              Severity
              Category
              Status
              Source
              Language