jasonwoods-7/Vandelay

View on GitHub

Showing 19 of 19 total issues

File ModuleWeaver.ReferenceFinder.cs has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using Vandelay.Fody.Extensions;

namespace Vandelay.Fody;

class Import
Severity: Minor
Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs - About 5 hrs to fix

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

      MethodDefinition InjectConstructor(
        IReadOnlyCollection<string> searchPatterns)
      {
        const MethodAttributes methodAttributes = MethodAttributes.SpecialName |
          MethodAttributes.RTSpecialName | MethodAttributes.HideBySig |
    Severity: Major
    Found in Vandelay.Fody/ModuleWeaver.Retriever.cs - About 2 hrs to fix

      Method GetInstructions has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        IEnumerable<Instruction> GetInstructions()
        {
          // var compositionBatch = new CompositionBatch();
          yield return Instruction.Create(OpCodes.Newobj,
            _import!.System.ComponentModel.Composition.Hosting.CompositionBatch.Constructor);
      Severity: Major
      Found in Vandelay.Fody/ModuleWeaver.CompositionBatch.cs - About 2 hrs to fix

        Method InjectSearchPatterns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          void InjectSearchPatterns(MethodDefinition constructor,
            IReadOnlyCollection<string> searchPatterns)
          {
            if (searchPatterns.Count == 0)
            {
        Severity: Minor
        Found in Vandelay.Fody/ModuleWeaver.Retriever.cs - About 1 hr to fix

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

                    public HostingImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                    {
                      AggregateCatalog = new AggregateCatalogImports(findType, moduleDefinition);
                      CompositionContainer =new CompositionContainerImports(findType, moduleDefinition);
                      DirectoryCatalog = new DirectoryCatalogImports(findType, moduleDefinition);
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 1 other location - About 1 hr to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 102..109

          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

                  public CompositionImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                  {
                    ImportManyAttribute = new ImportManyAttributeImports(findType, moduleDefinition);
                    Hosting = new HostingImports(findType, moduleDefinition);
                    AttributedModelServices = new AttributedModelServicesImports(findType, moduleDefinition);
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 1 other location - About 1 hr to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 131..138

          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

                  constructor.Body.Instructions.Add(Instruction.Create(OpCodes.Callvirt,
                    ModuleDefinition.ImportReference(_import.System.Collections.Generic.ICollection.Add.MakeGeneric(
                      _import.System.ComponentModel.Composition.Primitives.ComposablePartCatalog.Type))));
          Severity: Minor
          Found in Vandelay.Fody/ModuleWeaver.Retriever.cs and 1 other location - About 1 hr to fix
          Vandelay.Fody/ModuleWeaver.Retriever.cs on lines 175..177

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

          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

                constructor.Body.Instructions.Add(Instruction.Create(OpCodes.Callvirt,
                  ModuleDefinition.ImportReference(_import.System.Collections.Generic.ICollection.Add.MakeGeneric(
                    _import.System.ComponentModel.Composition.Primitives.ComposablePartCatalog.Type))));
          Severity: Minor
          Found in Vandelay.Fody/ModuleWeaver.Retriever.cs and 1 other location - About 1 hr to fix
          Vandelay.Fody/ModuleWeaver.Retriever.cs on lines 196..198

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

          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

                  internal class ImportManyAttributeImports
                  {
                    public ImportManyAttributeImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                    {
                      var importManyType = findType("System.ComponentModel.Composition.ImportManyAttribute");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 55 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 271..281
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 334..344

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

          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

                  internal class ExportAttributeImports
                  {
                    public ExportAttributeImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                    {
                      var attributeType = findType("System.ComponentModel.Composition.ExportAttribute");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 55 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 117..127
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 334..344

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

          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

                internal class DirectoryImports
                {
                  public DirectoryImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                  {
                    var directoryType = findType("System.IO.Directory");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 55 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 117..127
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 271..281

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

          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

                internal class DebuggerNonUserCodeAttributeImports
                {
                  public DebuggerNonUserCodeAttributeImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                  {
                    var attributeType = findType("System.Diagnostics.DebuggerNonUserCodeAttribute");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 50 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 346..356
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 359..369

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

          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

                internal class FileSystemInfoImports
                {
                  public FileSystemInfoImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                  {
                    var infoType = findType("System.IO.FileSystemInfo");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 50 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 359..369
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 380..390

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

          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

              internal class IDisposableImports
              {
                public IDisposableImports(Func<string, TypeDefinition> findType, ModuleDefinition moduleDefinition)
                {
                  var disposableType = findType("System.IDisposable");
          Severity: Major
          Found in Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs and 2 other locations - About 50 mins to fix
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 346..356
          Vandelay.Fody/ModuleWeaver.ReferenceFinder.cs on lines 380..390

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

          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 InjectUsingStatement has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            void InjectUsingStatement(MethodBody methodBody, Instruction bodyStart,
              OpCode loadLocation, Instruction handlerEnd, Instruction leave)
          Severity: Minor
          Found in Vandelay.Fody/ModuleWeaver.Retriever.cs - About 35 mins to fix

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

                yield return Instruction.Create(OpCodes.Callvirt, ModuleDefinition.ImportReference(
                  _import.System.Collections.Generic.Dictionary.SetItem.MakeGeneric(
                    TypeSystem.StringReference, TypeSystem.ObjectReference)));
            Severity: Minor
            Found in Vandelay.Fody/ModuleWeaver.CompositionBatch.cs and 1 other location - About 35 mins to fix
            Vandelay.Fody/ModuleWeaver.CompositionBatch.cs on lines 99..102

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

            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

                yield return Instruction.Create(OpCodes.Newobj,
                  ModuleDefinition.ImportReference(
                    _import.System.Collections.Generic.Dictionary.Constructor.MakeGeneric(
                      TypeSystem.StringReference, TypeSystem.ObjectReference)));
            Severity: Minor
            Found in Vandelay.Fody/ModuleWeaver.CompositionBatch.cs and 1 other location - About 35 mins to fix
            Vandelay.Fody/ModuleWeaver.CompositionBatch.cs on lines 109..111

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

            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

                constructor.Body.Instructions.Add(Instruction.Create(OpCodes.Call,
                  new MethodReference(".ctor", TypeSystem.VoidReference,
                    TypeSystem.ObjectReference)
                    { HasThis = true }));
            Severity: Minor
            Found in Vandelay.Fody/ModuleWeaver.Retriever.cs and 1 other location - About 30 mins to fix
            Vandelay.Fody/ModuleWeaver.ExportValueProvider.cs on lines 54..57

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

            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

                constructor.Body.Instructions.Add(Instruction.Create(OpCodes.Call,
                  new MethodReference(".ctor", TypeSystem.VoidReference,
                      TypeSystem.ObjectReference)
                    { HasThis = true }));
            Severity: Minor
            Found in Vandelay.Fody/ModuleWeaver.ExportValueProvider.cs and 1 other location - About 30 mins to fix
            Vandelay.Fody/ModuleWeaver.Retriever.cs on lines 103..106

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

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language