jiowchern/Regulus.Remote

View on GitHub

Showing 103 of 103 total issues

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

using Regulus.Network;
using Regulus.Network.Tcp;
using Regulus.Remote.Soul;
using System;

Severity: Major
Found in Regulus.Remote.Server/TcpListener.cs and 1 other location - About 4 hrs to fix
Regulus.Remote.Server/WebListener.cs on lines 1..70

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

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 Regulus.Network;
using Regulus.Network.Web;
using Regulus.Remote.Soul;
using System;

Severity: Major
Found in Regulus.Remote.Server/WebListener.cs and 1 other location - About 4 hrs to fix
Regulus.Remote.Server/TcpListener.cs on lines 1..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 291.

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

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

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

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

Refactorings

Further Reading

File SoulProvider.cs has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using Regulus.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Severity: Minor
Found in Regulus.Remote/SoulProvider.cs - About 4 hrs to fix

    Class SocketMessage has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public sealed class SocketMessage
        {
            public const int SeqIndex = 0;
            public const int AckIndex = SeqIndex + 2;
            public const int AckbitsIndex = AckIndex + 2;
    Severity: Minor
    Found in Regulus.Network/Package/SocketMessage.cs - About 4 hrs to fix

      Class SoulProvider has 28 methods (exceeds 20 allowed). Consider refactoring.
      Open

          public class SoulProvider : IDisposable, IBinder
          {
              private readonly IdLandlord _IdLandlord;
              private readonly Queue<byte[]> _EventFilter ;
      
      
      Severity: Minor
      Found in Regulus.Remote/SoulProvider.cs - About 3 hrs to fix

        File GhostProviderQueryer.cs has 302 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using Regulus.Remote.Extensions;
        using Regulus.Remote.Packages;
        using Regulus.Utility;
        using System;
        using System.Collections.Generic;
        Severity: Minor
        Found in Regulus.Remote/GhostProviderQueryer.cs - About 3 hrs to fix

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

                  public ClassAndTypes Mod(ClassDeclarationSyntax type)
                  {
                      var methods = type.DescendantNodes().OfType<MethodDeclarationSyntax>();
          
                      type = _ModifyMethodParameters(type, methods);
          Severity: Major
          Found in Regulus.Remote.Tools.Protocol.Sources/SyntaxModifier.cs - About 2 hrs to fix

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

                public class GhostProviderQueryer
                {
                    private readonly AutoRelease<long ,IGhost> _AutoRelease;
            
                    private readonly Dictionary<Type, IProvider> _Providers;
            Severity: Minor
            Found in Regulus.Remote/GhostProviderQueryer.cs - About 2 hrs to fix

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

                      IWaitableValue<int> IStreamable.Send(byte[] buffer, int offset, int buffer_length)
                      {
                          /*if (!Socket.Connected)
                          {
                              _SocketErrorEvent(SocketError.SocketError);
              Severity: Major
              Found in Regulus.Network/Tcp/Peer.cs and 1 other location - About 2 hrs to fix
              Regulus.Network/Tcp/Peer.cs on lines 34..53

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 182.

              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

                      IWaitableValue<int> IStreamable.Receive(byte[] readed_byte, int offset, int count)
                      {
                          /*if (!Socket.Connected)
                          {
                              _SocketErrorEvent( SocketError.SocketError);
              Severity: Major
              Found in Regulus.Network/Tcp/Peer.cs and 1 other location - About 2 hrs to fix
              Regulus.Network/Tcp/Peer.cs on lines 81..100

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

              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

              Class MemberMap has 22 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public class MemberMap : IEqualityComparer<Type>, IEqualityComparer<PropertyInfo>, IEqualityComparer<EventInfo>, IEqualityComparer<MethodInfo>, IEqualityComparer<int>
                  {
              
                      private readonly BilateralMap<int, MethodInfo> _Methods;
                      private readonly BilateralMap<int, EventInfo> _Events;
              Severity: Minor
              Found in Regulus.Remote/MemberMap.cs - About 2 hrs to fix

                Method CreateRegulusRemoteIEventProxyCreater has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public static ClassDeclarationSyntax CreateRegulusRemoteIEventProxyCreater(this EventDeclarationSyntax eds)
                        {
                            
                            var een = eds.ExplicitInterfaceSpecifier.Name.ToString().Replace('.', '_');
                
                

                  Method _OnResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          protected void _OnResponse(ServerToClientOpCode code, byte[] args)
                          {
                              _UpdateAutoRelease();
                              if (code == ServerToClientOpCode.Ping)
                              {
                  Severity: Major
                  Found in Regulus.Remote/GhostProviderQueryer.cs - About 2 hrs to fix

                    Similar blocks of code found in 3 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/RegulusRemoteIGhostEventAddEventEvent.cs on lines 1..38
                    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostEventCallMethodEvent.cs on lines 1..40

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                    using 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/RegulusRemoteIGhostEventAddEventEvent.cs on lines 1..38
                    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostEventRemoveEventEvent.cs on lines 1..38

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                    using 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/RegulusRemoteIGhostEventCallMethodEvent.cs on lines 1..40
                    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostEventRemoveEventEvent.cs on lines 1..38

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

                    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 static ClassDeclarationSyntax _InheriteProperties(BlockSyntax expression, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, ClassDeclarationSyntax classSyntax, System.Collections.Generic.IEnumerable<MemberDeclarationSyntax> nodes)
                            {
                                foreach (var member in nodes.OfType<PropertyDeclarationSyntax>())
                                {
                                    var node = member;
                    Severity: Major
                    Found in Regulus.Remote.Tools.Protocol.Sources/InterfaceInheritor.cs and 1 other location - About 2 hrs to fix
                    Regulus.Remote.Tools.Protocol.Sources/InterfaceInheritor.cs on lines 57..72

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

                    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 static ClassDeclarationSyntax _InheriteIndexs(BlockSyntax expression, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, ClassDeclarationSyntax classSyntax, System.Collections.Generic.IEnumerable<MemberDeclarationSyntax> nodes)
                            {
                                foreach (var member in nodes.OfType<IndexerDeclarationSyntax>())
                                {
                                    var node = member;
                    Severity: Major
                    Found in Regulus.Remote.Tools.Protocol.Sources/InterfaceInheritor.cs and 1 other location - About 2 hrs to fix
                    Regulus.Remote.Tools.Protocol.Sources/InterfaceInheritor.cs on lines 92..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 164.

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

                            public static ConstructorDeclarationSyntax Constructor(SyntaxToken name)
                            {
                                return ConstructorDeclaration(
                                                        name
                                                    )

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

                              public PropertyAndBlock Mod(System.Collections.Generic.IEnumerable<SyntaxNode> nodes)
                              {
                                  var block = nodes.Skip(0).FirstOrDefault() as BlockSyntax;
                                  var ad = nodes.Skip(1).FirstOrDefault() as AccessorDeclarationSyntax;
                                  var al = nodes.Skip(2).FirstOrDefault() as AccessorListSyntax;
                      Severity: Minor
                      Found in Regulus.Remote.Tools.Protocol.Sources/PropertyRegulusRemoteBlock.cs - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language