dolittle/DotNET.SDK

View on GitHub

Showing 230 of 230 total issues

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

using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Dolittle.SDK.Aggregates.Builders;
using Dolittle.SDK.Events;
using Dolittle.SDK.Tenancy;
Benchmarks/SDK/AggregateRoots/with_1_tenant/applying_events_with_100_events_to_replay.cs on lines 4..62

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

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.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Dolittle.SDK.Aggregates.Builders;
using Dolittle.SDK.Events;
using Dolittle.SDK.Tenancy;
Benchmarks/SDK/AggregateRoots/with_1_tenant/applying_events_with_1000_events_to_replay.cs on lines 4..62

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

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 DolittleClient.cs has 363 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
#if NET5_0_OR_GREATER
Severity: Minor
Found in Source/SDK/DolittleClient.cs - About 4 hrs to fix

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

    using Dolittle.Protobuf.Contracts;
    using Dolittle.Runtime.Events.Processing.Contracts;
    using Dolittle.Services.Contracts;
    using Grpc.Core;
    using static Dolittle.Runtime.Events.Processing.Contracts.Filters;
    Severity: Major
    Found in Source/Events.Filters/Internal/PublicEventFilterProtocol.cs and 2 other locations - About 3 hrs to fix
    Source/Events.Filters/Internal/PartitionedEventFilterProtocol.cs on lines 4..61
    Source/Events.Filters/Internal/UnpartitionedEventFilterProtocol.cs on lines 4..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 253.

    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 Dolittle.Protobuf.Contracts;
    using Dolittle.Runtime.Events.Processing.Contracts;
    using Dolittle.Services.Contracts;
    using Grpc.Core;
    using static Dolittle.Runtime.Events.Processing.Contracts.Filters;
    Source/Events.Filters/Internal/PartitionedEventFilterProtocol.cs on lines 4..61
    Source/Events.Filters/Internal/PublicEventFilterProtocol.cs on lines 4..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 253.

    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 Dolittle.Protobuf.Contracts;
    using Dolittle.Runtime.Events.Processing.Contracts;
    using Dolittle.Services.Contracts;
    using Grpc.Core;
    using static Dolittle.Runtime.Events.Processing.Contracts.Filters;
    Source/Events.Filters/Internal/PublicEventFilterProtocol.cs on lines 4..61
    Source/Events.Filters/Internal/UnpartitionedEventFilterProtocol.cs on lines 4..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 253.

    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 ReverseCallClient.cs has 297 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Threading;
    using System.Threading.Tasks;
    using Dolittle.SDK.DependencyInversion;
    using Dolittle.SDK.Execution;
    Severity: Minor
    Found in Source/Services/ReverseCallClient.cs - About 3 hrs to fix

      File ConventionProjectionBuilder.cs has 279 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections.Generic;
      using System.Diagnostics.CodeAnalysis;
      using System.Linq;
      using System.Reflection;
      Severity: Minor
      Found in Source/Projections/Builder/ConventionProjectionBuilder.cs - About 2 hrs to fix

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

        using System.Threading;
        using Dolittle.SDK.Events.Filters.Internal;
        using Dolittle.SDK.Events.Processing;
        using Microsoft.Extensions.Logging;
        
        
        Source/Events.Filters/Builders/Unpartitioned/UnregisteredUnpartitionedEventFilter.cs on lines 4..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 183.

        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.Threading;
        using Dolittle.SDK.Events.Filters.Internal;
        using Dolittle.SDK.Events.Processing;
        using Microsoft.Extensions.Logging;
        
        
        Source/Events.Filters/Builders/Partitioned/UnregisteredPartitionedEventFilter.cs on lines 4..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 183.

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

            public bool TryConvert(Runtime.Events.Contracts.CommittedEvent? source, [NotNullWhen(true)] out CommittedEvent? @event, [NotNullWhen(false)] out Exception? error)
            {
                @event = null;
        
                if (source == null)
        Severity: Major
        Found in Source/Events/Store/Converters/EventToSDKConverter.cs - About 2 hrs to fix

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

              async Task Register(AggregateRootAliasRegistrationRequest request, CancellationToken cancellationToken)
              {
                  _logger.Registering(request.AggregateRoot.Id.ToGuid(), request.Alias);
                  try
                  {
          Severity: Major
          Found in Source/Aggregates/Internal/AggregateRootsClient.cs and 1 other location - About 2 hrs to fix
          Source/Events/Internal/EventTypesClient.cs on lines 71..86

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

          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

              async Task Register(EventTypeRegistrationRequest request, CancellationToken cancellationToken)
              {
                  _logger.Registering(request.EventType.Id.ToGuid(), request.Alias);
                  try
                  {
          Severity: Major
          Found in Source/Events/Internal/EventTypesClient.cs and 1 other location - About 2 hrs to fix
          Source/Aggregates/Internal/AggregateRootsClient.cs on lines 69..84

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

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

              public async Task<bool> Connect(TConnectArguments connectArguments, CancellationToken cancellationToken)
              {
                  ThrowIfConnecting();
                  lock (_connectLock)
                  {
          Severity: Major
          Found in Source/Services/ReverseCallClient.cs - About 2 hrs to fix

            File ProjectionActor.cs has 262 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.Collections.Generic;
            using System.Threading.Tasks;
            using Dolittle.SDK.Async;
            using Dolittle.SDK.Events;
            Severity: Minor
            Found in Source/Projections/Actors/ProjectionActor.cs - About 2 hrs to fix

              Method Build has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public IModel Build(IClientBuildResults buildResults)
                  {
                      var validBindings = new List<IBinding>();
                      var deDuplicatedTypes = new DeDuplicatedIdentifierMap<Type>(
                          _typesByIdentifier,
              Severity: Major
              Found in Source/Common/Model/ModelBuilder.cs - About 2 hrs to fix

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

                    static ProjectionSignature<TProjection, TEvent> VoidReturnType<TEvent>(MethodInfo method, ProjectionParametersType parametersType) where TEvent : class
                    {
                        return parametersType switch
                        {
                            ProjectionParametersType.EventOnly
                Severity: Major
                Found in Source/Projections/Builder/ProjectionSignatureFactory.cs and 1 other location - About 2 hrs to fix
                Source/Projections/Builder/ProjectionSignatureFactory.cs on lines 133..147

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

                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

                    static ProjectionSignature<TProjection, TEvent> ResponseTypeReturn<TEvent>(MethodInfo method, ProjectionParametersType parametersType) where TEvent : class
                    {
                        return parametersType switch
                        {
                            ProjectionParametersType.EventOnly
                Severity: Major
                Found in Source/Projections/Builder/ProjectionSignatureFactory.cs and 1 other location - About 2 hrs to fix
                Source/Projections/Builder/ProjectionSignatureFactory.cs on lines 167..181

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

                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 override Task RegisterCodeFixesAsync(CodeFixContext context)
                    {
                        var document = context.Document;
                        var diagnostic = context.Diagnostics[0];
                        if (!diagnostic.Properties.TryGetValue("identityParameter", out var identityParameterName))
                Source/Analyzers/CodeFixes/AggregateMutationCodeFixProvider.cs on lines 28..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 162.

                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 override Task RegisterCodeFixesAsync(CodeFixContext context)
                    {
                        var document = context.Document;
                        var diagnostic = context.Diagnostics[0];
                        if (!diagnostic.Properties.TryGetValue("typeName", out var eventType))
                Source/Analyzers/CodeFixes/AttributeIdentityCodeFixProvider.cs on lines 26..47

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

                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