jiowchern/Regulus

View on GitHub

Showing 103 of 103 total issues

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

        public BlockAndEvent Mod(System.Collections.Generic.IEnumerable<SyntaxNode> nodes)
        {
            
            var block = nodes.Skip(0).FirstOrDefault() as BlockSyntax;
            var ad = nodes.Skip(1).FirstOrDefault() as AccessorDeclarationSyntax;
Severity: Minor
Found in Regulus.Remote.Tools.Protocol.Sources/EventBlockModifier.cs - About 1 hr to fix

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

            public static InterfaceDeclarationSyntax ToInferredInterface(this INamedTypeSymbol symbol)
            {
                
                var syntax = SyntaxFactory.InterfaceDeclaration(symbol.Name);
    
    
    Severity: Minor
    Found in Regulus.Remote.Tools.Protocol.Sources/SyntaxExtensions.cs - About 1 hr to fix

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

              internal void Remove(System.Reflection.EventInfo info, long handler)
              {
                  MemberMap map = _Protocol.GetMemberMap();
                  
      
      
      Severity: Major
      Found in Regulus.Remote/GhostEventMoveHandler.cs and 1 other location - About 1 hr to fix
      Regulus.Remote/GhostEventMoveHandler.cs on lines 20..33

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

      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

              internal void Add(System.Reflection.EventInfo info, long handler)
              {
                  MemberMap map = _Protocol.GetMemberMap();
      
      
      
      Severity: Major
      Found in Regulus.Remote/GhostEventMoveHandler.cs and 1 other location - About 1 hr to fix
      Regulus.Remote/GhostEventMoveHandler.cs on lines 37..51

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

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

              public BlockAndTypes Mod(System.Collections.Generic.IEnumerable<SyntaxNode> nodes)
              {
                  var block = nodes.Skip(0).FirstOrDefault() as BlockSyntax;
                  var md = nodes.Skip(1).FirstOrDefault() as MethodDeclarationSyntax;
                  var cd = nodes.Skip(2).FirstOrDefault() as ClassDeclarationSyntax;

        Method ToObject has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                int ITypeDescriber.ToObject(byte[] buffer, int begin, out object instance)
                {
                    ulong value;
                    int readed = Varint.BufferToNumber(buffer, begin, out value);
        
        
        Severity: Minor
        Found in Regulus.Serialization/NumberDescriber.cs - About 1 hr to fix

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

          using Microsoft.CodeAnalysis.CSharp;
          using Microsoft.CodeAnalysis.CSharp.Syntax;
          using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
          namespace Regulus.Remote.Tools.Protocol.Sources.Codes
          {
          Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostFieldHaveReturn.cs on lines 1..28

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

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

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

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

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

          Refactorings

          Further Reading

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

          using Microsoft.CodeAnalysis.CSharp;
          using Microsoft.CodeAnalysis.CSharp.Syntax;
          using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
          namespace Regulus.Remote.Tools.Protocol.Sources.Codes
          {
          Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostField_GhostId.cs on lines 1..28

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

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

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

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

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

          Refactorings

          Further Reading

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

          using Microsoft.CodeAnalysis.CSharp;
          using Microsoft.CodeAnalysis.CSharp.Syntax;
          using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
          namespace Regulus.Remote.Tools.Protocol.Sources.Codes
          {
          Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostGetID.cs on lines 1..30

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 123.

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

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

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

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

          Refactorings

          Further Reading

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

          using Microsoft.CodeAnalysis.CSharp;
          using Microsoft.CodeAnalysis.CSharp.Syntax;
          using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
          namespace Regulus.Remote.Tools.Protocol.Sources.Codes
          {
          Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostIsReturnType.cs on lines 1..30

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 123.

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

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

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

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

          Refactorings

          Further Reading

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

                          type = type.WithCloseBraceToken(
                                      SyntaxFactory.Token(
                                          SyntaxFactory.TriviaList(
                                              SyntaxFactory.Trivia(
                                                  SyntaxFactory.PragmaWarningDirectiveTrivia(
          Severity: Major
          Found in Regulus.Remote.Tools.Protocol.Sources/GhostBuilder.cs and 1 other location - About 1 hr to fix
          Regulus.Remote.Tools.Protocol.Sources/GhostBuilder.cs on lines 49..67

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

          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

                          type = type.WithOpenBraceToken(
                               SyntaxFactory.Token(
                                  SyntaxFactory.TriviaList(
                                      SyntaxFactory.Trivia(
                                          SyntaxFactory.PragmaWarningDirectiveTrivia(
          Severity: Major
          Found in Regulus.Remote.Tools.Protocol.Sources/GhostBuilder.cs and 1 other location - About 1 hr to fix
          Regulus.Remote.Tools.Protocol.Sources/GhostBuilder.cs on lines 81..99

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

          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

                  {
                      int readCount = 0;            
                      
                      for (int i = offset; i < buffer.Length; i++)
                      {
          Severity: Major
          Found in Regulus.Remote.Standalone/Stream.cs and 1 other location - About 1 hr to fix
          Regulus.Remote.Standalone/Stream.cs on lines 91..108

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

          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

                  {
                      int readCount = 0;
          
                      for (int i = offset; i < buffer.Length; i++)
                      {
          Severity: Major
          Found in Regulus.Remote.Standalone/Stream.cs and 1 other location - About 1 hr to fix
          Regulus.Remote.Standalone/Stream.cs on lines 27..42

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

          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 _ResultConnect(IAsyncResult Ar)
                  {
                      bool result = false;
                      try
                      {
          Severity: Major
          Found in Regulus.Network/Tcp/Connecter.cs and 1 other location - About 1 hr to fix
          Regulus.Network/Tcp/Connecter.cs on lines 32..52

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

          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 _ResultDisconnect(IAsyncResult arg)
                  {
                      bool result = false;
                      try
                      {
          Severity: Major
          Found in Regulus.Network/Tcp/Connecter.cs and 1 other location - About 1 hr to fix
          Regulus.Network/Tcp/Connecter.cs on lines 54..74

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

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

                  private void _InvokeMethod(long entity_id, int method_id, long returnId, byte[][] args)
                  {
                    
                      SoulProxy soul;
                      if (!_Souls.TryGetValue(entity_id, out soul))
          Severity: Minor
          Found in Regulus.Remote/SoulProvider.cs - About 1 hr to fix

            Method Mod has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public BlockAndTypes Mod(System.Collections.Generic.IEnumerable<SyntaxNode> nodes)
                    {
                        var block = nodes.Skip(0).FirstOrDefault() as BlockSyntax;            
                        var md = nodes.Skip(1).FirstOrDefault() as MethodDeclarationSyntax;
                        var cd = nodes.Skip(2).FirstOrDefault() as ClassDeclarationSyntax;
            Severity: Minor
            Found in Regulus.Remote.Tools.Protocol.Sources/MethodVoid.cs - About 1 hr to fix

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

                      public List<SocketMessage> PopLost(long Ticks, long Delta)
                      {
                          int count = m_Capacity;
                          List<SocketMessage> packages = new List<SocketMessage>();
                          foreach (Item item in m_Items.Values)
              Severity: Minor
              Found in Regulus.Network/CongestionRecorder.cs - About 1 hr to fix

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

                        public static string GetNamePath(this BaseTypeDeclarationSyntax syntax)
                        {
                            
                            var names = new System.Collections.Generic.Stack<string>();
                
                
                Severity: Minor
                Found in Regulus.Remote.Tools.Protocol.Sources/SyntaxExtensions.cs - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language