onebeyond/onebeyond-studio-core

View on GitHub

Showing 368 of 368 total issues

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

    [Fact]
    public void TestFileValidatorShouldNotAcceptDocuments()
    {
        var validator = new FileValidatorBuilder().AllowPng();

src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 13..30
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 96..113
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 160..178
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 212..229

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

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

    [Fact]
    public void TestFileValidatorShouldNotAcceptImages()
    {
        var validator = new FileValidatorBuilder().AllowDocuments();

src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 13..30
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 77..94
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 160..178
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 212..229

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

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

    [Fact]
    public void TestFileValidatorShouldAcceptDocuments()
    {
        var validator = new FileValidatorBuilder().AllowPdf();

src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 77..94
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 96..113
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 160..178
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 212..229

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

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

    [Fact]
    public void TestFileValidatorShouldNotAcceptSpreadsheets()
    {
        var validator = new FileValidatorBuilder().AllowPng();

src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 13..30
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 77..94
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 96..113
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 212..229

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

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

    [Fact]
    public void TestFileValidatorShouldAcceptText()
    {
        var validator = new FileValidatorBuilder().AllowSimpleText();

src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 13..30
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 77..94
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 96..113
src/OneBeyond.Studio.Crosscuts.Tests/FileUploadValidators.cs on lines 160..178

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

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 async Task<int> CountAsync(
        Expression<Func<TEntity, bool>>? filter = null,
        CancellationToken cancellationToken = default)
    {
        var query = await BuildListQueryAsync(filter).ConfigureAwait(false);
src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRORepository.cs on lines 113..120

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

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 async Task<bool> AnyAsync(
        Expression<Func<TEntity, bool>>? filter = null,
        CancellationToken cancellationToken = default)
    {
        var query = await BuildListQueryAsync(filter).ConfigureAwait(false);
src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRORepository.cs on lines 93..100

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

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

            var includes = new Includes<PurchaseOrder>()
                .Include((purchaseOrder) => purchaseOrder.Lines.Where((purchaseOrderLine) => purchaseOrderLine.ItemName.Contains('i')))
                    .ThenInclude((purchaseOrderLine) => purchaseOrderLine.Comments.Where((purchaseOrderLineComment) => purchaseOrderLineComment.Text.Contains('.')));
src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 740..742

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

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

            var includes = new Includes<PurchaseOrder>()
                .Include((purchaseOrder) => purchaseOrder.Lines.Where((purchaseOrderLine) => purchaseOrderLine.ItemName.Contains('i')))
                    .ThenInclude((purchaseOrderLine) => purchaseOrderLine.Comments.Where((purchaseOrderLineComment) => purchaseOrderLineComment.Text.Contains('.')))
src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 594..596

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

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

            var includes = new Includes<PurchaseOrder>()
                .Include((purchaseOrder) => purchaseOrder.Lines)
                .Where((purchaseOrderLine) => purchaseOrderLine.ItemName.Contains('i'))
                    .ThenInclude((purchaseOrderLine) => purchaseOrderLine.Comments)
                    //.Where((purchaseOrderLineComment) => !purchaseOrderLineComment.IsArchived);
src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 138..143

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

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

            var includes = new Includes<PurchaseOrder>()
                .Include((purchaseOrder) => purchaseOrder.Lines)
                .Where((purchaseOrderLine) => purchaseOrderLine.ItemName.Contains('i'))
                    .ThenInclude((purchaseOrderLine) => purchaseOrderLine.Comments)
                    //.Where((purchaseOrderLineComment) => !purchaseOrderLineComment.IsArchived);
src/OneBeyond.Studio.DataAccess.EFCore.Tests/FilteredIncludesTests.cs on lines 301..306

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

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

            foreach (var prop in type.GetTypeInfo().GetProperties())
            {
                var overrideAttr = prop.GetCustomAttribute<AuditPropertyValueAttribute>(true);
                if (overrideAttr != null)
                {
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/Attributes/AuditAttributesHelper.cs on lines 265..273

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

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

            foreach (var prop in type.GetTypeInfo().GetProperties())
            {
                var renamedAttr = prop.GetCustomAttribute<AuditPropertyNameAttribute>(true);
                if (renamedAttr != null)
                {
src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/Attributes/AuditAttributesHelper.cs on lines 291..299

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

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

    private static Dictionary<string, AuditPropertyValueAttribute> EnsurePropertiesOverrideAttrCache(Type type)
    {
        if (!_propertiesOverrideAttrCache.ContainsKey(type))
        {
            var overrideProps = new Dictionary<string, AuditPropertyValueAttribute>();

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

        [TestMethod]
        public async Task TestAggregateRootCreateMultipleEntitiesWithValidation()
        {
            var vendorVasyaId = default(Guid);
            var vendorPetyaId = default(Guid);
    Severity: Minor
    Found in src/OneBeyond.Studio.DataAccess.EFCore.Tests/AggregateRootTests.cs - About 1 hr to fix

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

          private sealed class LowerCasePolicy : CasingPolicy
          {
              public LowerCasePolicy()
                  : base("LowerCase", 3)
              {
      src/OneBeyond.Studio.Application.SharedKernel/Specifications/CasingPolicies.cs on lines 42..55

      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

          private sealed class SentenceCasePolicy : CasingPolicy
          {
              public SentenceCasePolicy()
                  : base("SentenceCase", 1)
              {
      src/OneBeyond.Studio.Application.SharedKernel/Specifications/CasingPolicies.cs on lines 87..100

      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

          private static bool EnsureEntitiesIgnoreAttrCache(Type type)
          {
              if (!_entitiesIgnoreAttrCache.ContainsKey(type))
              {
                  if (type.GetTypeInfo().GetCustomAttribute(typeof(AuditDontTrackAttribute), true) != null)
      src/OneBeyond.Studio.EntityAuditing/OneBeyond.Studio.EntityAuditing.Infrastructure/Attributes/AuditAttributesHelper.cs on lines 171..185

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

          public IIncludes<TEntity, TChild> Include<TChild>(
              Expression<Func<TEntity, IReadOnlyCollection<TChild>>> navigation)
              where TChild : class
          {
              EnsureArg.IsNotNull(navigation, nameof(navigation));
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/EFCoreIncludes.cs on lines 38..47
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/EFCoreIncludes.cs on lines 49..58

      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

          {
              var readDataAccessPolicy = await ReadDataAccessPolicy.Task.ConfigureAwait(false);
              var query = ApplyIncludes(DbSet.Value, includes);
              query = ApplyFiltering(query, filter);
              query = ApplyFiltering(query, readDataAccessPolicy?.CanBeAccessedCriteria);
      src/OneBeyond.Studio.DataAccess.EFCore/Repositories/BaseRWRepository.cs on lines 141..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 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

      Severity
      Category
      Status
      Source
      Language