dolittle/DotNET.SDK

View on GitHub

Showing 230 of 230 total issues

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

    internal async Task RehydrateInternal(IAsyncEnumerable<CommittedAggregateEvents> batches, IReadOnlyDictionary<Type, MethodInfo> onMethods,
        CancellationToken cancellationToken)
    {
        var hasBatches = false;
        var expectedVersion = AggregateRootVersion.Initial;
Severity: Minor
Found in Source/Aggregates/AggregateRoot.cs - About 1 hr to fix

    Method Validate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static bool Validate(ProjectionModelId identifier, IClientBuildResults buildResult, string collectionName)
        {
            var succeeded = true;
            if (string.IsNullOrEmpty(collectionName))
            {
    Severity: Minor
    Found in Source/Projections/Copies/MongoDB/MongoDbCollectionNameValidator.cs - About 1 hr to fix

      Method RetryEventHorizonSubscription has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              this ILogger logger,
              int retryCount,
              TimeSpan timeout,
              MicroserviceId producerMicroservice,
              TenantId producerTenant,
      Severity: Major
      Found in Source/SDK/Builders/Log.cs - About 1 hr to fix

        Method ConfigureOpenTelemetry has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static IHostBuilder ConfigureOpenTelemetry(this IHostBuilder builder, Func<OpenTelemetrySettings> getSettings)
            {
                // Defaults:
                // Exporter Endpoint env => OTEL_EXPORTER_OTLP_ENDPOINT
                // If env not set default is: grpc on http://localhost:4317 or http on http://localhost:4318

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

              public async Task<TResponse> Handle(TRequest request, ExecutionContext executionContext, IServiceProvider serviceProvider, CancellationToken cancellation)
              {
                  using var activity = request is HandleEventRequest ? null : executionContext
                      .StartChildActivity("Handle " + request.GetType().Name)
                      ?.SetTag("kind",Kind.Value);
          Severity: Minor
          Found in Source/Events.Processing/Internal/EventProcessor.cs - About 1 hr to fix

            Method StartEventProcessors has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                void StartEventProcessors(IPerformMethodCalls methodCaller, TimeSpan pingInterval, ExecutionContext executionContext, ILoggerFactory loggerFactory)
                {
                    var reverseCallClientsCreator = new ReverseCallClientCreator(
                        pingInterval,
                        methodCaller,
            Severity: Minor
            Found in Source/SDK/DolittleClient.cs - About 1 hr to fix

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

              using System;
              using Dolittle.SDK.Concepts;
              
              namespace Dolittle.SDK.Execution;
              
              
              Severity: Major
              Found in Source/Execution/HeadId.cs and 2 other locations - About 1 hr to fix
              Source/Events/ScopeId.cs on lines 4..32
              Source/Events/StreamId.cs on lines 4..33

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

              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;
              using Dolittle.SDK.Concepts;
              
              namespace Dolittle.SDK.Events;
              
              
              Severity: Major
              Found in Source/Events/StreamId.cs and 2 other locations - About 1 hr to fix
              Source/Events/ScopeId.cs on lines 4..32
              Source/Execution/HeadId.cs on lines 4..31

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

              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;
              using Dolittle.SDK.Concepts;
              
              namespace Dolittle.SDK.Events;
              
              
              Severity: Major
              Found in Source/Events/ScopeId.cs and 2 other locations - About 1 hr to fix
              Source/Events/StreamId.cs on lines 4..33
              Source/Execution/HeadId.cs on lines 4..31

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

              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 Dolittle.Runtime.Tenancy.Contracts;
              using Dolittle.SDK.Services;
              using Grpc.Core;
              
              namespace Dolittle.SDK.Tenancy.Client.Internal;
              Severity: Major
              Found in Source/Tenancy.Client/Internal/TenantsGetAllMethod.cs and 1 other location - About 1 hr to fix
              Source/Resources/MongoDB/Internal/ResourcesGetMongoDBMethod.cs on lines 4..22

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

              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 Dolittle.Runtime.Resources.Contracts;
              using Dolittle.SDK.Services;
              using Grpc.Core;
              
              namespace Dolittle.SDK.Resources.MongoDB.Internal;
              Source/Tenancy.Client/Internal/TenantsGetAllMethod.cs on lines 4..22

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

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

                  public static bool TryGetArgumentValue(this AttributeSyntax attribute, string parameterName, int parameterOrdinal, out ExpressionSyntax expressionSyntax)
                  {
                      if (attribute.ArgumentList is null)
                      {
                          expressionSyntax = default!;
              Severity: Minor
              Found in Source/Analyzers/AnalysisExtensions.cs - About 1 hr to fix

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

                    public async Task Handle(object @event, EventType eventType, EventContext context, IServiceProvider serviceProvider, CancellationToken cancellation)
                    {
                        var time = Stopwatch.StartNew();
                        using var activity = context.CommittedExecutionContext.StartChildActivity($"{_activityName}{@event.GetType().Name}");
                        activity?
                Severity: Minor
                Found in Source/Events.Handling/EventHandler.cs - About 1 hr to fix

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

                  using System;
                  using Dolittle.SDK.Concepts;
                  
                  namespace Dolittle.SDK.Failures;
                  
                  
                  Severity: Major
                  Found in Source/Failures/FailureId.cs and 1 other location - About 1 hr to fix
                  Source/Microservices/MicroserviceId.cs on lines 4..31

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

                  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 Dolittle.SDK.Concepts;
                  
                  namespace Dolittle.SDK.Microservices;
                  
                  
                  Severity: Major
                  Found in Source/Microservices/MicroserviceId.cs and 1 other location - About 1 hr to fix
                  Source/Failures/FailureId.cs on lines 4..31

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

                  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.Runtime.Events.Contracts;
                  using Dolittle.SDK.Services;
                  using Grpc.Core;
                  
                  namespace Dolittle.SDK.Events.Internal;
                  Severity: Major
                  Found in Source/Events/Internal/EventTypesRegisterMethod.cs and 2 other locations - About 1 hr to fix
                  Source/Aggregates/Internal/AggregateRootsRegisterAliasMethod.cs on lines 4..22
                  Source/SDK/Handshake/Internal/HandshakeMethod.cs on lines 4..22

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

                  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.Runtime.Handshake.Contracts;
                  using Dolittle.SDK.Services;
                  using Grpc.Core;
                  
                  namespace Dolittle.SDK.Handshake.Internal;
                  Severity: Major
                  Found in Source/SDK/Handshake/Internal/HandshakeMethod.cs and 2 other locations - About 1 hr to fix
                  Source/Aggregates/Internal/AggregateRootsRegisterAliasMethod.cs on lines 4..22
                  Source/Events/Internal/EventTypesRegisterMethod.cs on lines 4..22

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

                  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.Runtime.Aggregates.Contracts;
                  using Dolittle.SDK.Services;
                  using Grpc.Core;
                  
                  namespace Dolittle.SDK.Aggregates.Internal;
                  Source/Events/Internal/EventTypesRegisterMethod.cs on lines 4..22
                  Source/SDK/Handshake/Internal/HandshakeMethod.cs on lines 4..22

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

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

                  public record PropertyConversion(PropertyName PropertyName, Conversion ConvertTo, IEnumerable<PropertyConversion> Children, PropertyName RenameTo = default)
                  {
                      /// <summary>
                      /// Converts to <see cref="Runtime.Events.Processing.Contracts.ProjectionCopyToMongoDB.Types.PropertyConversion"/>.
                      /// </summary>
                  Severity: Minor
                  Found in Source/Projections/Copies/MongoDB/PropertyConversion.cs - About 1 hr to fix

                    Method TryToClaims has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static bool TryToClaims(this IEnumerable<PbClaim> source, out Claims claims, [NotNullWhen(false)] out Exception? error)
                        {
                            claims = null;
                            if (source == null)
                            {
                    Severity: Minor
                    Found in Source/Protobuf/ClaimExtensions.cs - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language