jiowchern/Regulus

View on GitHub

Showing 103 of 103 total issues

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

        public int Read(byte[] buffer, int offset, int buffer_count)
        {
            lock (_Packages)
            {
                int count = buffer_count < buffer.Length ? buffer_count : buffer.Length;
Severity: Minor
Found in Regulus.Network/SegmentStream.cs - About 1 hr to fix

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

            private void _LoadSoul(int type_id, long id, bool return_type)
            {
                Regulus.Remote.Packages.PackageLoadSoul package = new Regulus.Remote.Packages.PackageLoadSoul();
                package.TypeId = type_id;
                package.EntityId = id;
    Severity: Major
    Found in Regulus.Remote/SoulProvider.cs and 2 other locations - About 1 hr to fix
    Regulus.Remote/SoulProvider.cs on lines 183..190
    Regulus.Remote/SoulProvider.cs on lines 313..321

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

    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/RegulusRemoteIGhostField_CallMethodEvent.cs on lines 1..26
    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostField_RemoveEventEvent.cs on lines 1..26

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

    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

            private void _LoadSoulCompile(int type_id, long id, long return_id)
            {
                Regulus.Remote.Packages.PackageLoadSoulCompile package = new Regulus.Remote.Packages.PackageLoadSoulCompile();
                package.EntityId = id;
                package.ReturnId = return_id;
    Severity: Major
    Found in Regulus.Remote/SoulProvider.cs and 2 other locations - About 1 hr to fix
    Regulus.Remote/SoulProvider.cs on lines 200..209
    Regulus.Remote/SoulProvider.cs on lines 313..321

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

    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

            private void _ErrorDeserialize(string method_name, long return_id, string message)
            {
                Regulus.Remote.Packages.PackageErrorMethod package = new Regulus.Remote.Packages.PackageErrorMethod();
                package.Message = message;
                package.Method = method_name;
    Severity: Major
    Found in Regulus.Remote/SoulProvider.cs and 2 other locations - About 1 hr to fix
    Regulus.Remote/SoulProvider.cs on lines 183..190
    Regulus.Remote/SoulProvider.cs on lines 200..209

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

    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/RegulusRemoteIGhostField_AddEventEvent.cs on lines 1..26
    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostField_CallMethodEvent.cs on lines 1..26

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

    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/RegulusRemoteIGhostField_AddEventEvent.cs on lines 1..26
    Regulus.Remote.Tools.Protocol.Sources/Codes/RegulusRemoteIGhostField_RemoveEventEvent.cs on lines 1..26

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

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

            private static MethodDeclarationSyntax _ToMethod(IMethodSymbol methodSymbol)
            {
                var retType = _GetTypeSyntax(methodSymbol.ReturnType);
                var method = SyntaxFactory.MethodDeclaration(retType, methodSymbol.Name);
                var list = SyntaxFactory.ParameterList();
    Severity: Minor
    Found in Regulus.Remote.Tools.Protocol.Sources/SyntaxExtensions.cs - About 1 hr to fix

      Method _Run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private void _Run(object state)
              {
                  ManualResetEvent mre = new ManualResetEvent(true);
      
                  while (_Enable)
      Severity: Minor
      Found in Regulus.Network/SocketSender.cs - About 1 hr to fix

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

                public static System.Reflection.MethodInfo Execute(this System.Linq.Expressions.Expression<GetObjectAccesserMethod> arg )
                {
                    var e0 = arg.Reduce();
                    System.Linq.Expressions.LambdaExpression e1;            
                    if (e0.IsNotType(out e1))
        Severity: Minor
        Found in Regulus.Remote/ExpressionsExtensions.cs - About 1 hr to fix

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

                  int ITypeDescriber.ToObject(byte[] buffer, int begin, out object instnace)
                  {
                      try
                      {
                          int offset = begin;
          Severity: Minor
          Found in Regulus.Serialization/ArrayDescriber.cs - About 1 hr to fix

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

                    private ValidObjectSet _GetSet(object instance)
                    {
                        IList array = instance as IList;
            
                        int validLength = 0;
            Severity: Minor
            Found in Regulus.Serialization/ArrayDescriber.cs - About 1 hr to fix

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

                      public void InvokeEvent(int event_id, long handler_id, byte[][] event_params)
                      {
                          IGhost ghost = _Base.GetTargetOrException(); 
              
                          MemberMap map = _MemberMap;
              Severity: Minor
              Found in Regulus.Remote/GhostResponseHandler.cs - About 1 hr to fix

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

                        public byte[] ObjectToBuffer(object instance)
                        {
                
                            try
                            {
                Severity: Minor
                Found in Regulus.Serialization/Serializer.cs - About 1 hr to fix

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

                                  var validFields = _Fields.Select(
                                         (field, index) => new
                                         {
                                             field,
                                             index
                  Severity: Major
                  Found in Regulus.Serialization/ClassDescriber.cs and 1 other location - About 1 hr to fix
                  Regulus.Serialization/ClassDescriber.cs on lines 93..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 94.

                  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

                                  var validFields = _Fields.Select(
                                             (field, index) => new
                                             {
                                                 field,
                                                 index
                  Severity: Major
                  Found in Regulus.Serialization/ClassDescriber.cs and 1 other location - About 1 hr to fix
                  Regulus.Serialization/ClassDescriber.cs on lines 42..47

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

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

                          void ISourceGenerator.Execute(GeneratorExecutionContext context)
                          {
                              
                  
                              var logger = new DialogProvider();
                  Severity: Minor
                  Found in Regulus.Remote.Tools.Protocol.Sources/SourceGenerator.cs - About 1 hr to fix

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

                            private void _Supply<T>(T instance)
                            {
                                Type type = instance.GetType();
                                Type[] parents = type.GetInterfaces();
                                foreach (Type p in parents)
                    Severity: Minor
                    Found in Regulus.Remote.Client/AgentEventRectifier.cs and 1 other location - About 1 hr to fix
                    Regulus.Remote.Client/AgentEventRectifier.cs on lines 78..90

                    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

                                var eventProxys= ghostBuilder.EventProxys.Select(e => CSharpSyntaxTree.ParseText(root.AddMembers(e).NormalizeWhitespace().ToString(),null,$"{name}.{e.Identifier}.cs", System.Text.Encoding.UTF8));
                    Regulus.Remote.Tools.Protocol.Sources/ProjectSourceBuilder.cs on lines 25..25

                    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

                                var ghosts  = ghostBuilder.Ghosts.Select(e => CSharpSyntaxTree.ParseText(root.AddMembers(e).NormalizeWhitespace().ToString(), null, $"{name}.{e.Identifier}.cs", System.Text.Encoding.UTF8));
                    Regulus.Remote.Tools.Protocol.Sources/ProjectSourceBuilder.cs on lines 24..24

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language