Showing 230 of 230 total issues
Method RunProcessorForeverUntilCancelled
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async Task RunProcessorForeverUntilCancelled<TIdentifier, TClientMessage, TServerMessage, TRegisterArguments, TRegisterResponse, TRequest, TResponse>(
IEventProcessor<TIdentifier, TRegisterArguments, TRequest, TResponse> eventProcessor,
IAmAReverseCallProtocol<TClientMessage, TServerMessage, TRegisterArguments, TRegisterResponse, TRequest, TResponse> protocol,
CancellationToken cancellationToken)
where TIdentifier : ConceptAs<Guid>
Method CreateConstruct
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static Func<IServiceProvider, EventSourceId, Try<TAggregateRoot>> CreateConstruct(Type aggregateRootType)
{
if (!TryGetConstructor(aggregateRootType, out var constructor, out var e))
{
// Not instantiatable
Method FromConfiguration
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static DolittleClientConfiguration FromConfiguration(Configurations.Dolittle config)
{
var result = new DolittleClientConfiguration();
if (!string.IsNullOrEmpty(config.Runtime.Host))
Method Perform
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<TResponse> Perform<TResponse>(Func<TAggregate, TResponse> method, CancellationToken cancellationToken = default)
{
if(cancellationToken == default)
{
cancellationToken = _defaultTimeout();
Method ReceiveAsync
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task ReceiveAsync(IContext context)
{
try
{
switch (context.Message)
Method Commit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<CommittedEvents> Commit(UncommittedEvents uncommittedEvents, CancellationToken cancellationToken = default)
{
using var activity = Tracing.ActivitySource.StartActivity()
?.Tag(uncommittedEvents);
Method CommitForAggregate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<CommittedAggregateEvents> CommitForAggregate(UncommittedAggregateEvents uncommittedAggregateEvents, CancellationToken cancellationToken = default)
{
using var activity = Tracing.ActivitySource.StartActivity()
?.Tag(uncommittedAggregateEvents);
Similar blocks of code found in 2 locations. Consider refactoring. Open
var singlyBoundTypes = new SinglyBoundDeDuplicatedIdentifierMap<Type>(
deDuplicatedTypes,
(type, identifiers) =>
{
var sb = new StringBuilder();
- Read upRead up
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 111.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var singlyBoundProcessorBuilders = new SinglyBoundDeDuplicatedIdentifierMap<object>(
deDuplicatedProcessorBuilders,
(processorBuilder, identifiers) =>
{
var sb = new StringBuilder();
- Read upRead up
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 111.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!eventType.HasEventTypeAttribute())
{
context.ReportDiagnostic(Diagnostic.Create(
DescriptorRules.Events.MissingAttribute,
parameters[0].DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation(),
- Read upRead up
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 107.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!eventType.HasEventTypeAttribute())
{
context.ReportDiagnostic(Diagnostic.Create(
DescriptorRules.Events.MissingAttribute,
parameters[0].DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation(),
- Read upRead up
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 107.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method AddProtoCluster
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static IServiceCollection AddProtoCluster(this IServiceCollection self, GetClusterKinds getClusterKinds)
{
self.AddSingleton(p =>
{
var loggerFactory = p.GetRequiredService<ILoggerFactory>();
Method Start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task Start()
{
if (_started)
{
return;
Method RegistrationsFor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public IEnumerable<IComponentRegistration> RegistrationsFor(Service service, Func<Service, IEnumerable<ServiceRegistration>> registrationAccessor)
{
if (service is not IServiceWithType serviceWithType)
{
return Enumerable.Empty<IComponentRegistration>();
Method AddProtoInfra
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static IServiceCollection AddProtoInfra(this IServiceCollection services, GetClusterKinds getClusterKinds)
{
return AddProtoCluster(services, getClusterKinds)
.AddSingleton<GetServiceProviderForTenant>(sp =>
{
Method ParametersAreValid
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
internal static bool ParametersAreValid(MethodInfo method, [NotNullWhen(true)] out ProjectionParametersType? parametersType)
{
var parameters = method.GetParameters();
parametersType = default;
if (parameters.Length is 0 or > 2)
Method On
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
void On(CommittedEvent evt)
{
var eventType = evt.EventType;
if (!_projection.Events.TryGetValue(eventType, out var keySelector))
{
Method Perform
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task Perform(Func<TAggregate, Task> method, CancellationToken cancellationToken = default)
{
if(cancellationToken == default)
{
cancellationToken = _defaultTimeout();
Method AddToContainer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
void AddToContainer(TenantId tenantId, IServiceCollection serviceCollection)
{
foreach (var projection in Values)
{
var readModelType = projection.ProjectionType;
Method CheckOnReturnType
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void CheckOnReturnType(SyntaxNodeAnalysisContext context, INamedTypeSymbol projectionType, IMethodSymbol onMethod,
MethodDeclarationSyntax syntax)
{
// Check for valid return type. Valid types are void, ProjectionResultType and ProjectionResult<>
var returnType = onMethod.ReturnType;