guibranco/CrispyWaffle

View on GitHub

Showing 121 of 121 total issues

File ServiceLocator.cs has 538 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Severity: Major
Found in Src/CrispyWaffle/Composition/ServiceLocator.cs - About 1 day to fix

    File CacheManager.cs has 391 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using CrispyWaffle.Composition;
    Severity: Minor
    Found in Src/CrispyWaffle/Cache/CacheManager.cs - About 5 hrs to fix

      File LogConsumer.cs has 373 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections.Generic;
      using System.Collections.ObjectModel;
      using System.ComponentModel;
      using System.Diagnostics;
      Severity: Minor
      Found in Src/CrispyWaffle/Log/LogConsumer.cs - About 4 hrs to fix

        File ConversionExtensions.cs has 352 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Collections.Generic;
        using System.Globalization;
        using System.Linq;
        using System.Reflection;
        Severity: Minor
        Found in Src/CrispyWaffle/Extensions/ConversionExtensions.cs - About 4 hrs to fix

          Class ServiceLocator has 34 methods (exceeds 20 allowed). Consider refactoring.
          Open

              public static class ServiceLocator
              {
                  /// <summary>
                  /// The locks.
                  /// </summary>
          Severity: Minor
          Found in Src/CrispyWaffle/Composition/ServiceLocator.cs - About 4 hrs to fix

            File StringExtensions.cs has 344 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.Collections.Generic;
            using System.Diagnostics.Contracts;
            using System.IO;
            using System.Linq;
            Severity: Minor
            Found in Src/CrispyWaffle/Extensions/StringExtensions.cs - About 4 hrs to fix

              Class LogConsumer has 30 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public static class LogConsumer
                  {
                      /// <summary>
                      /// The log providers
                      /// </summary>
              Severity: Minor
              Found in Src/CrispyWaffle/Log/LogConsumer.cs - About 3 hrs to fix

                Class StringExtensions has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    public static class StringExtensions
                    {
                        /// <summary>
                        /// Replaces the non alphanumeric.
                        /// </summary>
                Severity: Minor
                Found in Src/CrispyWaffle/Extensions/StringExtensions.cs - About 3 hrs to fix

                  File RedisCacheRepository.cs has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using System;
                  using System.Collections.Generic;
                  using System.Globalization;
                  using CrispyWaffle.Cache;
                  using CrispyWaffle.Log;
                  Severity: Minor
                  Found in Src/CrispyWaffle.Redis/Cache/RedisCacheRepository.cs - About 2 hrs to fix

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

                    using System.Threading;
                    using System.Threading.Tasks;
                    using CrispyWaffle.Infrastructure;
                    using StackExchange.Redis;
                    
                    Src/CrispyWaffle.Redis/Log/PropagationStrategy/OperationPropagationStrategy.cs on lines 1..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 190.

                    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 System.Threading.Tasks;
                    using CrispyWaffle.Infrastructure;
                    using StackExchange.Redis;
                    
                    Src/CrispyWaffle.Redis/Log/PropagationStrategy/ProcessPropagationStrategy.cs on lines 1..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 190.

                    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

                    Class ConversionExtensions has 23 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        public static class ConversionExtensions
                        {
                            /// <summary>
                            /// An IEnumerable&lt;String&gt; extension method that converts a binary representation
                            /// string to the bytes.
                    Severity: Minor
                    Found in Src/CrispyWaffle/Extensions/ConversionExtensions.cs - About 2 hrs to fix

                      Class CacheManager has 22 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          public static class CacheManager
                          {
                              /// <summary>
                              /// The repositories
                              /// </summary>
                      Severity: Minor
                      Found in Src/CrispyWaffle/Cache/CacheManager.cs - About 2 hrs to fix

                        Class RollingTextFileLogAdapter has 22 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            public sealed class RollingTextFileLogAdapter : ITextFileLogAdapter
                            {
                                /// <inheritdoc />
                                public void Dispose()
                                {
                        Severity: Minor
                        Found in Src/CrispyWaffle/Log/Adapters/RollingTextFileLogAdapter.cs - About 2 hrs to fix

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

                                      var field = type.GetFields()
                                          .Select(f => new
                                          {
                                              Field = f,
                                              Attr = Attribute.GetCustomAttribute(f, typeof(HumanReadableAttribute))
                          Severity: Major
                          Found in Src/CrispyWaffle/Extensions/EnumExtensions.cs and 1 other location - About 2 hrs to fix
                          Src/CrispyWaffle/Extensions/EnumExtensions.cs on lines 84..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 151.

                          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 field = type.GetFields()
                                          .Select(f => new
                                          {
                                              Field = f,
                                              Attr = Attribute.GetCustomAttribute(f, typeof(InternalValueAttribute))
                          Severity: Major
                          Found in Src/CrispyWaffle/Extensions/EnumExtensions.cs and 1 other location - About 2 hrs to fix
                          Src/CrispyWaffle/Extensions/EnumExtensions.cs on lines 31..50

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

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

                                  private static object CreateInstanceInternal(Type implementationType)
                                  {
                                      if (_dependenciesCache.TryGetValue(implementationType, out var dependencies))
                                      {
                                          return Activator.CreateInstance(
                          Severity: Minor
                          Found in Src/CrispyWaffle/Composition/ServiceLocator.cs - About 1 hr to fix

                            Method GetEnumByInternalValueAttribute has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public static T GetEnumByInternalValueAttribute<T>(string internalValue)
                                    {
                                        var type = typeof(T);
                                        if (!type.IsEnum)
                                        {
                            Severity: Minor
                            Found in Src/CrispyWaffle/Extensions/EnumExtensions.cs - About 1 hr to fix

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

                                      {
                                          var type = typeof(TCacheRepository);
                                          LogConsumer.Trace(
                                              "Adding {0} to repository of type {1} with TTL of {2:g}",
                                              key,
                              Severity: Major
                              Found in Src/CrispyWaffle/Cache/CacheManager.cs and 1 other location - About 1 hr to fix
                              Src/CrispyWaffle/Cache/CacheManager.cs on lines 205..222

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

                              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 type = typeof(TCacheRepository);
                                          LogConsumer.Trace(
                                              "Adding {0}/{2} to repository of type {1}",
                                              key,
                              Severity: Major
                              Found in Src/CrispyWaffle/Cache/CacheManager.cs and 1 other location - About 1 hr to fix
                              Src/CrispyWaffle/Cache/CacheManager.cs on lines 238..255

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

                              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