microting/eform-sdk-dotnet

View on GitHub
eFormCore/Communication/Http.cs

Summary

Maintainability
F
1 wk
Test Coverage

File Http.cs has 893 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.CodeDom.Compiler;
using System.IO;
using System.Net;
using System.Net.Http;
Severity: Major
Found in eFormCore/Communication/Http.cs - About 2 days to fix

    Class Http has 55 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public class Http : IHttp
        {
            private const string ProtocolXml = "6";
            private const string ProtocolEntitySearch = "1";
            private const string ProtocolEntitySelect = "4";
    Severity: Major
    Found in eFormCore/Communication/Http.cs - About 7 hrs to fix

      Method HttpPost has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private async Task<string> HttpPost(string url, StringContent content, string contentType = null,
                  bool addToken = false, bool followRedirect = false)
              {
                  try
                  {
      Severity: Minor
      Found in eFormCore/Communication/Http.cs - About 1 hr to fix

        Method HttpDelete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private async Task<string> HttpDelete(string url, string contentType = null, bool addToken = false,
                    bool followRedirect = false)
                {
                    try
                    {
        Severity: Minor
        Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                  private async Task<string> HttpPut(string url, StringContent content, string contentType = null,
                      bool addToken = false, bool followRedirect = false)
                  {
                      try
                      {
          Severity: Minor
          Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                    public async Task<int> SpeechToText(Stream pathToAudioFile, string language, string extension)
                    {
                        try
                        {
                            var url = $"{_addressSpeechToText}/audio/?token={_token}&sdk_ver={_dllVersion}&lang={language}";
            Severity: Minor
            Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                      private async Task<string> HttpGet(string url, string contentType = null, bool addToken = false)
                      {
                          try
                          {
                              var start = DateTime.UtcNow;
              Severity: Minor
              Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                        public async Task<string> Post(string data, string siteId, string contentType = "application/xml")
                        {
                            try
                            {
                                WriteDebugConsoleLogEntry($"{GetType()}.{MethodBase.GetCurrentMethod()?.Name}",
                Severity: Minor
                Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                          public async Task<string> Delete(string elementId, string siteId)
                          {
                              try
                              {if (_addressNewApi != "none")
                                  {
                  Severity: Minor
                  Found in eFormCore/Communication/Http.cs - About 1 hr to fix

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

                            public async Task<string> UnitUpdate(int id, bool newOtp, int siteId, bool pushEnabled, bool syncDelayEnabled,
                                bool syncDialogEnabled)
                    Severity: Minor
                    Found in eFormCore/Communication/Http.cs - About 45 mins to fix

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

                              public async Task<bool> FolderUpdate(int id, string name, string description, string languageCode,
                                  int? parentId)
                      Severity: Minor
                      Found in eFormCore/Communication/Http.cs - About 35 mins to fix

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

                                public async Task<bool> EntitySelectItemUpdate(string entitySelectGroupId, string entitySelectItemId,
                                    string name, int displayIndex, string ownUuid)
                        Severity: Minor
                        Found in eFormCore/Communication/Http.cs - About 35 mins to fix

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

                                  private async Task<string> HttpPost(string url, StringContent content, string contentType = null,
                                      bool addToken = false, bool followRedirect = false)
                          Severity: Minor
                          Found in eFormCore/Communication/Http.cs - About 35 mins to fix

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

                                    public async Task<bool> EntitySearchItemUpdate(string entitySearchGroupId, string entitySearchItemId,
                                        string name, string description, string id)
                            Severity: Minor
                            Found in eFormCore/Communication/Http.cs - About 35 mins to fix

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

                                      private async Task<string> HttpPut(string url, StringContent content, string contentType = null,
                                          bool addToken = false, bool followRedirect = false)
                              Severity: Minor
                              Found in eFormCore/Communication/Http.cs - About 35 mins to fix

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

                                        private async Task<string> HttpPut(string url, StringContent content, string contentType = null,
                                            bool addToken = false, bool followRedirect = false)
                                        {
                                            try
                                            {
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 4 hrs to fix
                                eFormCore/Communication/Http.cs on lines 77..118

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

                                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 async Task<string> HttpPost(string url, StringContent content, string contentType = null,
                                            bool addToken = false, bool followRedirect = false)
                                        {
                                            try
                                            {
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 4 hrs to fix
                                eFormCore/Communication/Http.cs on lines 120..160

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

                                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 async Task<string> FolderDelete(int id)
                                        {
                                            try
                                            {
                                                var url =
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 2 hrs to fix
                                eFormCore/Communication/Http.cs on lines 744..758

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

                                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 async Task<string> WorkerDelete(int id)
                                        {
                                            try
                                            {
                                                var url =
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 2 hrs to fix
                                eFormCore/Communication/Http.cs on lines 827..842

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

                                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 url =
                                                $"{_addressApi}/gwt/inspection_app/searchable_items/{entitySelectItemId}.json?token={_token}&protocol={ProtocolEntitySelect}&organization_id={_organizationId}&sdk_ver={_dllVersion}";
                                            var newUrl =
                                                await HttpDelete(url, "application/json").ConfigureAwait(false); // todo maybe not need content type
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 1 hr to fix
                                eFormCore/Communication/Http.cs on lines 528..535

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

                                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 url =
                                                    $"{_addressApi}/gwt/inspection_app/searchable_item_groups/{entityGroupId}.json?token={_token}&protocol={ProtocolEntitySelect}&organization_id={_organizationId}&sdk_ver={_dllVersion}";
                                                var newUrl =
                                                    await HttpDelete(url, "application/json").ConfigureAwait(false); // todo maybe not need content type
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 1 hr to fix
                                eFormCore/Communication/Http.cs on lines 589..596

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

                                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 void WriteErrorConsoleLogEntry(string classMethodName, string message)
                                        {
                                            var oldColor = Console.ForegroundColor;
                                            Console.ForegroundColor = ConsoleColor.Red;
                                            Console.WriteLine($"[ERR] {classMethodName}: {message}");
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 40 mins to fix
                                eFormCore/Communication/Http.cs on lines 1017..1023

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

                                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 void WriteDebugConsoleLogEntry(string classMethodName, string message)
                                        {
                                            var oldColor = Console.ForegroundColor;
                                            Console.ForegroundColor = ConsoleColor.Gray;
                                            Console.WriteLine($"[DBG] {classMethodName}: {message}");
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 40 mins to fix
                                eFormCore/Communication/Http.cs on lines 1025..1031

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                            var content = new StringContent("<Entities><Entity>" +
                                                                            $"<EntityTypeId>{entitySearchGroupId}</EntityTypeId>" +
                                                                            $"<Identifier><![CDATA[{name}]]></Identifier>" +
                                                                            $"<Description><![CDATA[{description}]]></Description>" +
                                                                            "<Km></Km><Colour></Colour><Radiocode></Radiocode>" + // todo Legacy. To be removed server side
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 40 mins to fix
                                eFormCore/Communication/Http.cs on lines 462..468

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                            var content = new StringContent("<Entities><Entity>" +
                                                                            $"<EntityTypeId>{entitySearchGroupId}</EntityTypeId>" +
                                                                            $"<Identifier><![CDATA[{name}]]></Identifier>" +
                                                                            $"<Description><![CDATA[{description}]]></Description>" +
                                                                            "<Km></Km><Colour></Colour><Radiocode></Radiocode>" + // todo Legacy. To be removed server side
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 40 mins to fix
                                eFormCore/Communication/Http.cs on lines 439..445

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

                                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 async Task<string> GetSurveyConfiguration(int id)
                                        {
                                            var url = $"{_addressBasic}/v1/survey_configurations/{id}?token={_token}&sdk_ver={_dllVersion}";
                                            return await HttpGet(url).ConfigureAwait(false);
                                        }
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 997..1001

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

                                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 async Task<string> GetQuestionSet(int id)
                                        {
                                            var url = $"{_addressBasic}/v1/question_sets/{id}?token={_token}&sdk_ver={_dllVersion}";
                                            return await HttpGet(url).ConfigureAwait(false);
                                        }
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 985..989

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

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> SiteWorkerLoadAllFromRemote()
                                        {
                                            var url = $"{_newAddressBasic}/Worker?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                        }
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 710..715
                                eFormCore/Communication/Http.cs on lines 760..764
                                eFormCore/Communication/Http.cs on lines 802..806
                                eFormCore/Communication/Http.cs on lines 858..862
                                eFormCore/Communication/Http.cs on lines 912..916

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> UnitLoadAllFromRemote()
                                        {
                                            var url = $"{_newAddressBasic}/Unit?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                        }
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 710..715
                                eFormCore/Communication/Http.cs on lines 760..764
                                eFormCore/Communication/Http.cs on lines 796..800
                                eFormCore/Communication/Http.cs on lines 802..806
                                eFormCore/Communication/Http.cs on lines 912..916

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> OrganizationLoadAllFromRemote()
                                        {
                                            var url = $"{_newAddressBasic}/Organization?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                        }
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 710..715
                                eFormCore/Communication/Http.cs on lines 760..764
                                eFormCore/Communication/Http.cs on lines 796..800
                                eFormCore/Communication/Http.cs on lines 802..806
                                eFormCore/Communication/Http.cs on lines 858..862

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> SiteLoadAllFromRemote()
                                        {
                                            var url =
                                                $"{_newAddressBasic}/Site?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 760..764
                                eFormCore/Communication/Http.cs on lines 796..800
                                eFormCore/Communication/Http.cs on lines 802..806
                                eFormCore/Communication/Http.cs on lines 858..862
                                eFormCore/Communication/Http.cs on lines 912..916

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> WorkerLoadAllFromRemote()
                                        {
                                            var url = $"{_newAddressBasic}/User?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                        }
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 710..715
                                eFormCore/Communication/Http.cs on lines 796..800
                                eFormCore/Communication/Http.cs on lines 802..806
                                eFormCore/Communication/Http.cs on lines 858..862
                                eFormCore/Communication/Http.cs on lines 912..916

                                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 6 locations. Consider refactoring.
                                Open

                                        public async Task<string> FolderLoadAllFromRemote()
                                        {
                                            var url = $"{_newAddressBasic}/Folder?token={_token}&sdkVersion={_dllVersion}";
                                            return await HttpGet(url, null, true).ConfigureAwait(false);
                                        }
                                Severity: Major
                                Found in eFormCore/Communication/Http.cs and 5 other locations - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 710..715
                                eFormCore/Communication/Http.cs on lines 760..764
                                eFormCore/Communication/Http.cs on lines 796..800
                                eFormCore/Communication/Http.cs on lines 858..862
                                eFormCore/Communication/Http.cs on lines 912..916

                                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

                                            var newUrl = await HttpPut(url,
                                                new StringContent(contentToServer.ToString(), Encoding.UTF8, "application/json"), "application/json",
                                                true).ConfigureAwait(false); // todo maybe not need content type
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 674..676

                                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

                                            var newUrl = await HttpPost(url,
                                                new StringContent(contentToServer.ToString(), Encoding.UTF8, "application/json"), "application/json",
                                                true).ConfigureAwait(false); // todo maybe not need content type
                                Severity: Minor
                                Found in eFormCore/Communication/Http.cs and 1 other location - About 30 mins to fix
                                eFormCore/Communication/Http.cs on lines 688..690

                                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

                                There are no issues that match your filters.

                                Category
                                Status