CORE-POS/IS4C

View on GitHub
pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs

Summary

Maintainability
F
1 wk
Test Coverage

File JsonSerializerInternalWriter.cs has 819 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
#if !(NET35 || NET20 || PORTABLE40)

    Class JsonSerializerInternalWriter has 37 methods (exceeds 20 allowed). Consider refactoring.
    Open

        internal class JsonSerializerInternalWriter : JsonSerializerInternalBase
        {
            private JsonContract _rootContract;
            private int _rootLevel;
            private readonly List<object> _serializeStack = new List<object>();

      Method SerializeDynamic has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
      Open

              private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
              {
                  OnSerializing(writer, contract, value);
                  _serializeStack.Add(value);
      
      

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method SerializeDynamic has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
              {
                  OnSerializing(writer, contract, value);
                  _serializeStack.Add(value);
      
      

        Method SerializeObject has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
                {
                    OnSerializing(writer, contract, value);
        
                    _serializeStack.Add(value);

          Method SerializeValue has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private void SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
                  {
                      if (value == null)
                      {
                          writer.WriteNull();

            Method SerializeDictionary has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private void SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
                    {
                        IWrappedDictionary wrappedDictionary = values as IWrappedDictionary;
                        object underlyingDictionary = wrappedDictionary != null ? wrappedDictionary.UnderlyingDictionary : values;
            
            

              Method SerializeMultidimensionalArray has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, int initialDepth, int[] indices)
                      {
                          int dimension = indices.Length;
                          int[] newIndices = new int[dimension + 1];
                          for (int i = 0; i < dimension; i++)

                Method SerializeList has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
                        {
                            IWrappedCollection wrappedCollection = values as IWrappedCollection;
                            object underlyingList = wrappedCollection != null ? wrappedCollection.UnderlyingCollection : values;
                
                

                  Method GetPropertyName has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private string GetPropertyName(JsonWriter writer, object name, JsonContract contract, out bool escape)
                          {
                              string propertyName;
                  
                              if (contract.ContractType == JsonContractType.Primitive)

                    Method CheckForCircularReference has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private bool CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
                            {
                                if (value == null || contract.ContractType == JsonContractType.Primitive || contract.ContractType == JsonContractType.String)
                                    return true;
                    
                    

                      Method SerializeObject has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                      Open

                              private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
                              {
                                  OnSerializing(writer, contract, value);
                      
                                  _serializeStack.Add(value);

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method SerializeISerializable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [SecuritySafeCritical]
                      #endif
                              private void SerializeISerializable(JsonWriter writer, ISerializable value, JsonISerializableContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
                              {
                                  if (!JsonTypeReflector.FullyTrusted)

                        Method CalculatePropertyValues has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private bool CalculatePropertyValues(JsonWriter writer, object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, out JsonContract memberContract, out object memberValue)
                                {
                                    if (!property.Ignored && property.Readable && ShouldSerialize(writer, property, value) && IsSpecified(writer, property, value))
                                    {
                                        if (property.PropertyContract == null)

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

                                  internal static bool TryConvertToString(object value, Type type, out string s)
                                  {
                          #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
                                      TypeConverter converter = ConvertUtils.GetConverter(type);
                          
                          

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

                                    private bool ShouldWriteType(TypeNameHandling typeNameHandlingFlag, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
                                    {
                                        TypeNameHandling resolvedTypeNameHandling =
                                            ((member != null) ? member.TypeNameHandling : null)
                                            ?? ((containerProperty != null) ? containerProperty.ItemTypeNameHandling : null)

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

                                      public void Serialize(JsonWriter jsonWriter, object value, Type objectType)
                                      {
                                          if (jsonWriter == null)
                                              throw new ArgumentNullException("jsonWriter");
                              
                              

                                Method CheckForCircularReference has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                                Open

                                        private bool CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
                                        {
                                            if (value == null || contract.ContractType == JsonContractType.Primitive || contract.ContractType == JsonContractType.String)
                                                return true;
                                
                                

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method CalculatePropertyValues has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        private bool CalculatePropertyValues(JsonWriter writer, object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, out JsonContract memberContract, out object memberValue)

                                  Method SerializeMultidimensionalArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                    Method SerializeISerializable has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            private void SerializeISerializable(JsonWriter writer, ISerializable value, JsonISerializableContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                      Method SerializeList has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              private void SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                        Method SerializeObject has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                private void SerializeObject(JsonWriter writer, object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                          Method SerializeDictionary has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                                  private void SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                            Method WriteObjectStart has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                    private void WriteObjectStart(JsonWriter writer, object value, JsonContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                              Method CheckForCircularReference has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                      private bool CheckForCircularReference(JsonWriter writer, object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)

                                                Method SerializeDynamic has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                        private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                                  Method SerializePrimitive has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                          private void SerializePrimitive(JsonWriter writer, object value, JsonPrimitiveContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)

                                                    Method SerializeValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                            private void SerializeValue(JsonWriter writer, object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)

                                                      Method SerializeConvertable has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                              private void SerializeConvertable(JsonWriter writer, JsonConverter converter, object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                                        Method SerializeMultidimensionalArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                                private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, int initialDepth, int[] indices)

                                                          Method WriteStartArray has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                                  private bool WriteStartArray(JsonWriter writer, object values, JsonArrayContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)

                                                            Method SerializeMultidimensionalArray has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                                                            Open

                                                                    private void SerializeMultidimensionalArray(JsonWriter writer, Array values, JsonArrayContract contract, JsonProperty member, int initialDepth, int[] indices)
                                                                    {
                                                                        int dimension = indices.Length;
                                                                        int[] newIndices = new int[dimension + 1];
                                                                        for (int i = 0; i < dimension; i++)

                                                            Cognitive Complexity

                                                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                            A method's cognitive complexity is based on a few simple rules:

                                                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                            • Code is considered more complex for each "break in the linear flow of the code"
                                                            • Code is considered more complex when "flow breaking structures are nested"

                                                            Further reading

                                                            Method ShouldWriteType has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                    private bool ShouldWriteType(TypeNameHandling typeNameHandlingFlag, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)

                                                              Method ShouldWriteReference has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                      private bool ShouldWriteReference(object value, JsonProperty property, JsonContract valueContract, JsonContainerContract collectionContract, JsonProperty containerProperty)

                                                                Method ShouldWriteType has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                                                                Open

                                                                        private bool ShouldWriteType(TypeNameHandling typeNameHandlingFlag, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
                                                                        {
                                                                            TypeNameHandling resolvedTypeNameHandling =
                                                                                ((member != null) ? member.TypeNameHandling : null)
                                                                                ?? ((containerProperty != null) ? containerProperty.ItemTypeNameHandling : null)

                                                                Cognitive Complexity

                                                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                A method's cognitive complexity is based on a few simple rules:

                                                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                • Code is considered more complex for each "break in the linear flow of the code"
                                                                • Code is considered more complex when "flow breaking structures are nested"

                                                                Further reading

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                            return false;

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                  return name.ToString();

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

                                                                                    try
                                                                                    {
                                                                                        object memberValue;
                                                                                        JsonContract memberContract;
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 791..808

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

                                                                    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

                                                                                        try
                                                                                        {
                                                                                            object memberValue;
                                                                                            JsonContract memberContract;
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 398..415

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

                                                                    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 bool IsSpecified(JsonWriter writer, JsonProperty property, object target)
                                                                            {
                                                                                if (property.GetIsSpecified == null)
                                                                                    return true;
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 1014..1025

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

                                                                    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 bool ShouldSerialize(JsonWriter writer, JsonProperty property, object target)
                                                                            {
                                                                                if (property.ShouldSerialize == null)
                                                                                    return true;
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 1027..1038

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

                                                                    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

                                                                                    {
                                                                                        JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value);
                                                                    
                                                                                        if (ShouldWriteReference(value, null, valueContract, contract, member))
                                                                                        {
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 669..683

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

                                                                    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

                                                                                        {
                                                                                            JsonContract valueContract = contract.FinalItemContract ?? GetContractSafe(value);
                                                                    
                                                                                            if (ShouldWriteReference(value, null, valueContract, contract, member))
                                                                                            {
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 592..606

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

                                                                    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 void OnSerialized(JsonWriter writer, JsonContract contract, object value)
                                                                            {
                                                                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
                                                                                    TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, "Finished serializing {0}".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 369..375

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

                                                                    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 void OnSerializing(JsonWriter writer, JsonContract contract, object value)
                                                                            {
                                                                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
                                                                                    TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, "Started serializing {0}".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType)), null);
                                                                    
                                                                    
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 377..383

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

                                                                    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

                                                                                    if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
                                                                                        TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, "Started serializing {0} with converter {1}.".FormatWith(CultureInfo.InvariantCulture, value.GetType(), converter.GetType())), null);
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 565..566

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

                                                                    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

                                                                                    if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Info)
                                                                                        TraceWriter.Trace(TraceLevel.Info, JsonPosition.FormatMessage(null, writer.Path, "Finished serializing {0} with converter {1}.".FormatWith(CultureInfo.InvariantCulture, value.GetType(), converter.GetType())), null);
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 560..561

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

                                                                    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

                                                                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)
                                                                                    TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, "Writing object reference Id '{0}' for {1}.".FormatWith(CultureInfo.InvariantCulture, reference, type)), null);
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 525..526

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

                                                                    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

                                                                                if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)
                                                                                    TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, "Writing type name '{0}' for {1}.".FormatWith(CultureInfo.InvariantCulture, typeName, type)), null);
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 514..515

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

                                                                    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

                                                                                    {
                                                                                        escape = false;
                                                                                        StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);
                                                                                        DateTimeUtils.WriteDateTimeString(sw, (DateTime)name, writer.DateFormatHandling, writer.DateFormatString, writer.Culture);
                                                                                        return sw.ToString();
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 976..981

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

                                                                    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

                                                                                    {
                                                                                        escape = false;
                                                                                        StringWriter sw = new StringWriter(CultureInfo.InvariantCulture);
                                                                                        DateTimeUtils.WriteDateTimeOffsetString(sw, (DateTimeOffset)name, writer.DateFormatHandling, writer.DateFormatString, writer.Culture);
                                                                                        return sw.ToString();
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 968..973

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

                                                                    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

                                                                                        case ReferenceLoopHandling.Serialize:
                                                                                            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)
                                                                                                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, message + ". Serializing self referenced value."), null);
                                                                    
                                                                                            return true;
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 279..283

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

                                                                    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

                                                                                        case ReferenceLoopHandling.Ignore:
                                                                                            if (TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose)
                                                                                                TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(null, writer.Path, message + ". Skipping serializing self referenced value."), null);
                                                                    
                                                                                            return false;
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs on lines 284..288

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

                                                                    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

                                                                                TypeNameHandling resolvedTypeNameHandling =
                                                                                    ((member != null) ? member.TypeNameHandling : null)
                                                                                    ?? ((containerProperty != null) ? containerProperty.ItemTypeNameHandling : null)
                                                                                    ?? ((containerContract != null) ? containerContract.ItemTypeNameHandling : null)
                                                                                    ?? Serializer._typeNameHandling;
                                                                    pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs on lines 692..696

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

                                                                    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

                                                                    There are no issues that match your filters.

                                                                    Category
                                                                    Status