guibranco/CrispyWaffle

View on GitHub

Showing 121 of 121 total issues

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

    public virtual void Save<T>(string file, T deserialized)
        where T : class
    {
        Stream stream = null;
        try
Severity: Minor
Found in Src/CrispyWaffle/Serialization/Adapters/BaseSerializerAdapter.cs - About 1 hr to fix

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

            public static void Debug(string message)
            {
                var category = GetCategory();
    
                foreach (
    Severity: Major
    Found in Src/CrispyWaffle/Log/LogConsumer.cs and 5 other locations - About 1 hr to fix
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 391..405
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 473..487
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 503..517
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 533..547
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 563..577

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

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

            public static void Error(string message)
            {
                var category = GetCategory();
    
                foreach (
    Severity: Major
    Found in Src/CrispyWaffle/Log/LogConsumer.cs and 5 other locations - About 1 hr to fix
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 312..326
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 391..405
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 473..487
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 503..517
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 563..577

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

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

            public static void Warning(string message)
            {
                var category = GetCategory();
    
                foreach (
    Severity: Major
    Found in Src/CrispyWaffle/Log/LogConsumer.cs and 5 other locations - About 1 hr to fix
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 312..326
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 391..405
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 473..487
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 533..547
    Src/CrispyWaffle/Log/LogConsumer.cs on lines 563..577

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

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

            private static void UpdateValueInternal<T>(
                T currentObject,
                T newObject,
                PropertyInfo propertyInfo,
                T defaultObject,
    Severity: Minor
    Found in Src/CrispyWaffle/Extensions/TypeExtensions.cs - About 1 hr to fix

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

              public override NotNullObserver Read(
                  ref Utf8JsonReader reader,
                  Type typeToConvert,
                  JsonSerializerOptions options
              )

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

                public T Get<T>(string key, string subKey)
                {
                    try
                    {
                        if (
        Severity: Minor
        Found in Src/CrispyWaffle.Redis/Cache/RedisCacheRepository.cs - About 1 hr to fix

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

                  private void DoWork(
                      string exchange,
                      string queue,
                      bool autoAck,
                      CancellationToken cancellationToken
          Severity: Minor
          Found in Src/CrispyWaffle.RabbitMQ/Helpers/MessageReceiver.cs - About 1 hr to fix

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

                    public static int ToModule10(this string input)
                    {
                        var number = Regex.Replace(
                            input,
                            "[^0-9]",
            Severity: Minor
            Found in Src/CrispyWaffle/Extensions/ConversionExtensions.cs - About 1 hr to fix

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

                      public static string GetHumanReadableValue(this Enum value, string flagsSeparator = " | ")
                      {
                          var type = value.GetType();
                          if (
                              type.GetCustomAttributes(typeof(FlagsAttribute), false).Any()
              Severity: Minor
              Found in Src/CrispyWaffle/Extensions/EnumExtensions.cs - About 1 hr to fix

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

                        public static string Encrypt(
                            this string plainText,
                            string passwordHash,
                            string saltKey,
                            string viKey
                Severity: Minor
                Found in Src/CrispyWaffle/Cryptography/Security.cs - About 1 hr to fix

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

                          public static bool TryParseBrazilianPhoneNumber(this string number, ref PhoneNumber result)
                          {
                              var dirty = number.RemoveNonNumeric();
                              var dirtyLength = dirty.Length;
                  
                  Severity: Minor
                  Found in Src/CrispyWaffle/Extensions/ConversionExtensions.cs - About 1 hr to fix

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

                            {
                                var category = GetCategory();
                    
                                foreach (
                                    var provider in _providers.Where(p =>
                    Severity: Major
                    Found in Src/CrispyWaffle/Log/LogConsumer.cs and 1 other location - About 1 hr to fix
                    Src/CrispyWaffle/Log/LogConsumer.cs on lines 344..357

                    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

                            {
                                var category = GetCategory();
                    
                                foreach (
                                    var provider in _providers.Where(p =>
                    Severity: Major
                    Found in Src/CrispyWaffle/Log/LogConsumer.cs and 1 other location - About 1 hr to fix
                    Src/CrispyWaffle/Log/LogConsumer.cs on lines 423..436

                    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

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

                            public static bool IsNumericType(this Type type)
                            {
                                while (true)
                                {
                                    var typeCode = Type.GetTypeCode(type);
                    Severity: Minor
                    Found in Src/CrispyWaffle/Extensions/TypeExtensions.cs - About 1 hr to fix

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

                              public static string GetMessages(
                                  this Queue<Exception> exceptions,
                                  string category,
                                  ICollection<ILogProvider> additionalProviders
                              )
                      Severity: Minor
                      Found in Src/CrispyWaffle/Extensions/ExceptionExtensions.cs - About 1 hr to fix

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

                                private static string GetCategory()
                                {
                                    var stack = new StackTrace();
                        
                                    var counter = 1;
                        Severity: Major
                        Found in Src/CrispyWaffle/Log/Handlers/DefaultExceptionHandler.cs and 1 other location - About 1 hr to fix
                        Src/CrispyWaffle/Log/LogConsumer.cs on lines 72..90

                        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

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

                                private static string GetCategory()
                                {
                                    var stack = new StackTrace();
                                    var counter = 1;
                                    while (true)
                        Severity: Major
                        Found in Src/CrispyWaffle/Log/LogConsumer.cs and 1 other location - About 1 hr to fix
                        Src/CrispyWaffle/Log/Handlers/DefaultExceptionHandler.cs on lines 33..53

                        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

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

                                private void RemoveInternal(string path)
                                {
                                    try
                                    {
                                        LogConsumer.Info("Uploading to FtpClient the file: {0}", path.GetPathOrFileName());
                        Severity: Minor
                        Found in Src/CrispyWaffle.Utils/Communications/FtpClient.cs - About 1 hr to fix

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

                                  private static List<int> GenerateRange(string value)
                                  {
                                      var result = new List<int>();
                          
                                      var split = value.Split('-');
                          Severity: Minor
                          Found in Src/CrispyWaffle/Scheduler/CronScheduler.cs - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language