guibranco/Sankhya-SDK-dotnet

View on GitHub

Showing 326 of 326 total issues

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

using CrispyWaffle.Attributes;

namespace Sankhya.Enums;

/// <summary>
Severity: Major
Found in Src/Sankhya/Enums/TradingSubType.cs and 2 other locations - About 2 hrs to fix
Src/Sankhya/Enums/InvoiceFollowUpReference.cs on lines 15..87
Src/Sankhya/Enums/ProductSource.cs on lines 15..97

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

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 CrispyWaffle.Attributes;

namespace Sankhya.Enums;

/// <summary>
Severity: Major
Found in Src/Sankhya/Enums/ProductSource.cs and 2 other locations - About 2 hrs to fix
Src/Sankhya/Enums/InvoiceFollowUpReference.cs on lines 15..87
Src/Sankhya/Enums/TradingSubType.cs on lines 15..87

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

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 CrispyWaffle.Attributes;

namespace Sankhya.Enums;

/// <summary>
Severity: Major
Found in Src/Sankhya/Enums/InvoiceFollowUpReference.cs and 2 other locations - About 2 hrs to fix
Src/Sankhya/Enums/ProductSource.cs on lines 15..97
Src/Sankhya/Enums/TradingSubType.cs on lines 15..87

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

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

File ResponseBody.cs has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System.ComponentModel;
using System.Xml.Serialization;
using CrispyWaffle.Extensions;

namespace Sankhya.Service;
Severity: Minor
Found in Src/Sankhya/Service/ResponseBody.cs - About 2 hrs to fix

    Method Resolve has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static void Resolve<T>(this ServiceRequest request)
            where T : class, IEntity, new()
        {
            if (request == null)
            {
    Severity: Major
    Found in Src/Sankhya/Helpers/ServiceRequestExtensions.cs - About 2 hrs to fix

      Method ParseResponseBodyElements has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private bool ParseResponseBodyElements(XmlReader reader)
          {
              var entities = new List<EntityDynamicSerialization>();
      
              switch (reader.LocalName)
      Severity: Major
      Found in Src/Sankhya/Service/ServiceResponse.cs - About 2 hrs to fix

        Class SimpleCrudRequestWrapper has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public static class SimpleCrudRequestWrapper
        {
            /// <summary>
            /// The Sankhya context.
            /// </summary>
        Severity: Minor
        Found in Src/Sankhya/RequestWrappers/SimpleCRUDRequestWrapper.cs - About 2 hrs to fix

          Class Contact has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

          [Entity("Contato")]
          public class Contact : IEntity, IEquatable<Contact>
          {
              /// <summary>
              /// Indicates whether the current object is equal to another object of the same type.
          Severity: Minor
          Found in Src/Sankhya/Transport/Contact.cs - About 2 hrs to fix

            Method ProcessFieldsAndCriteria has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static void ProcessFieldsAndCriteria<T>(
                    ServiceRequest request,
                    T criteriaEntity,
                    ReferenceLevel currentLevel,
                    PropertyInfo propertyInfo,
            Severity: Major
            Found in Src/Sankhya/Helpers/ServiceRequestExtensions.cs - About 2 hrs to fix

              Method Equals has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public bool Equals(Product other)
                  {
                      if (ReferenceEquals(null, other))
                      {
                          return false;
              Severity: Major
              Found in Src/Sankhya/Transport/Product.cs - About 2 hrs to fix

                File City.cs has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using System.ComponentModel;
                using System.Diagnostics.CodeAnalysis;
                using CrispyWaffle.Serialization;
                using Sankhya.Attributes;
                
                
                Severity: Minor
                Found in Src/Sankhya/Transport/City.cs - About 2 hrs to fix

                  File RequestBody.cs has 279 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using System.ComponentModel;
                  using System.Xml.Serialization;
                  
                  namespace Sankhya.Service;
                  
                  
                  Severity: Minor
                  Found in Src/Sankhya/Service/RequestBody.cs - About 2 hrs to fix

                    Method GetHashCode has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        [SuppressMessage(
                            "ReSharper",
                            "NonReadonlyMemberInGetHashCode",
                            Justification = "Used to compute hash internally"
                        )]
                    Severity: Major
                    Found in Src/Sankhya/Transport/PartnerComplement.cs - About 2 hrs to fix

                      File SimpleCRUDRequestWrapper.cs has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      using CrispyWaffle.Composition;
                      using CrispyWaffle.Log;
                      using Sankhya.Enums;
                      using Sankhya.GoodPractices;
                      using Sankhya.Helpers;
                      Severity: Minor
                      Found in Src/Sankhya/RequestWrappers/SimpleCRUDRequestWrapper.cs - About 2 hrs to fix

                        Class InvoiceHeaderExclusion has 24 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        [Entity("CabecalhoNotaExcluida")]
                        public class InvoiceHeaderExclusion : IEntity, IEquatable<InvoiceHeaderExclusion>
                        {
                            /// <summary>
                            /// Indicates whether the current object is equal to another object of the same type.
                        Severity: Minor
                        Found in Src/Sankhya/Transport/InvoiceHeaderExclusion.cs - About 2 hrs to fix

                          File Financial.cs has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          using System.ComponentModel;
                          using System.Diagnostics.CodeAnalysis;
                          using System.Globalization;
                          using CrispyWaffle.Extensions;
                          using Sankhya.Attributes;
                          Severity: Minor
                          Found in Src/Sankhya/Transport/Financial.cs - About 2 hrs to fix

                            Method GetImage has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public ServiceFile GetImage(string entity, Dictionary<string, object> keys)
                                {
                                    HttpWebResponse response = null;
                                    try
                                    {
                            Severity: Major
                            Found in Src/Sankhya/SankhyaWrapper.cs - About 2 hrs to fix

                              Method Resolve has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static void Resolve<T>(this ServiceRequest request, ICollection<T> criteriaList)
                                      where T : class, IEntity, new()
                                  {
                                      if (request == null)
                                      {
                              Severity: Major
                              Found in Src/Sankhya/Helpers/ServiceRequestExtensions.cs - About 2 hrs to fix

                                Method ServiceInvokerInternal has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private ServiceResponse ServiceInvokerInternal(
                                        ServiceRequest request,
                                        ServiceName serviceName,
                                        RequestRetryData retryData
                                    )
                                Severity: Major
                                Found in Src/Sankhya/SankhyaWrapper.cs - About 2 hrs to fix

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

                                  [XmlType("liberacao")]
                                  public sealed class Release
                                  {
                                      /// <summary>
                                      /// The key
                                  Severity: Minor
                                  Found in Src/Sankhya/Service/Release.cs - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language