microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method Core_eForm_OptionsWithMicrotingFormFromXML_ReturnseMainElement has 452 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task Core_eForm_OptionsWithMicrotingFormFromXML_ReturnseMainElement()
        {
            // Arrange
            string xmlstring = @"
Severity: Major
Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormFromXML.cs - About 2 days to fix

    Method MoveTranslations has a Cognitive Complexity of 126 (exceeds 20 allowed). Consider refactoring.
    Open

            public static async Task MoveTranslations(MicrotingDbContext dbContext)
            {
                try
                {
                    List<Field> fields = await dbContext.Fields.ToListAsync();
    Severity: Minor
    Found in eFormCore/Infrastructure/Data/Entities/Field.cs - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method DocxToPdf has a Cognitive Complexity of 125 (exceeds 20 allowed). Consider refactoring.
    Open

            private async Task<string> DocxToPdf(int caseId, string templateId, string timeStamp,
                Microting.eForm.Infrastructure.Data.Entities.Case dbCase, CaseDto cDto, string customPathForUploadedData,
                string customXmlContent, string fileType, Language language)
            {
                SortedDictionary<string, string> valuePairs = new SortedDictionary<string, string>();
    Severity: Minor
    Found in eFormCore/Core.cs - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File Http.cs has 897 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

      File SqlControllerTestUnit.cs has 894 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using eFormCore;
      using Microsoft.EntityFrameworkCore;
      using NUnit.Framework;
      using System;
      using System.Collections.Generic;
      Severity: Major
      Found in eFormSDK.Integration.Tests/SqlControllerTestUnit.cs - About 2 days to fix

        Method CreateDataItem has a Cognitive Complexity of 114 (exceeds 20 allowed). Consider refactoring.
        Open

                private async Task CreateDataItem(int? parentFieldId, int elementId, DataItem dataItem, Language language)
                {
                    string methodName = "SqlController.CreateDataItem";
                    try
                    {
        Severity: Minor
        Found in eFormCore/Infrastructure/SqlController.cs - About 1 day to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File CoreTestCaseReadAllShort.cs has 825 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Collections.Generic;
        using System.IO;
        using System.Linq;
        using System.Reflection;
        Severity: Major
        Found in eFormSDK.Integration.Case.CoreTests/CoreTestCaseReadAllShort.cs - About 1 day to fix

          File SqlControllerTestWorker.cs has 804 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using eFormCore;
          using Microsoft.EntityFrameworkCore;
          using NUnit.Framework;
          using System;
          using System.Collections.Generic;
          Severity: Major
          Found in eFormSDK.Integration.Tests/SqlControllerTestWorker.cs - About 1 day to fix

            File FieldsUTest.cs has 797 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Threading.Tasks;
            using Microsoft.EntityFrameworkCore;
            Severity: Major
            Found in eFormSDK.CheckLists.Tests/FieldsUTest.cs - About 1 day to fix

              Method GenerateDataSetFromCasesSubSet has a Cognitive Complexity of 108 (exceeds 20 allowed). Consider refactoring.
              Open

                      private async Task<List<string>> GenerateDataSetFromCasesSubSet(List<string> lstReturn, int? checkListId,
                          string preLabel, Language language, bool includeCheckListText)
                      {
                          string sep = " / ";
                          await using MicrotingDbContext dbContext = DbContextHelper.GetDbContext();
              Severity: Minor
              Found in eFormCore/Core.cs - About 1 day to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method Core_Template_TemplateItemReadAll_DoesReturnSortedTemplates has 359 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Core_Template_TemplateItemReadAll_DoesReturnSortedTemplates()
                      {
                          // Arrance
              
              
              Severity: Major
              Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteForm.cs - About 1 day to fix

                File SqlControllerTestSite.cs has 762 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using eFormCore;
                using Microsoft.EntityFrameworkCore;
                using NUnit.Framework;
                using System;
                using System.Collections.Generic;
                Severity: Major
                Found in eFormSDK.Integration.Tests/SqlControllerTestSite.cs - About 1 day to fix

                  Method Up has 356 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          protected override void Up(MigrationBuilder migrationBuilder)
                          {
                              //Setup for SQL Server Provider
                             
                              string autoIDGenStrategy = "SqlServer:ValueGenerationStrategy";
                  Severity: Major
                  Found in eFormCore/Migrations/20190315092242_AddingModelseForInsight.cs - About 1 day to fix

                    Method AddDefaultLanguages has 350 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public static async Task AddDefaultLanguages(MicrotingDbContext dbContext)
                            {
                    
                                if (dbContext.Languages.FirstOrDefault(x => x.Name == "Danish") != null)
                                {
                    Severity: Major
                    Found in eFormCore/Infrastructure/Data/Entities/Language.cs - About 1 day to fix

                      File CoreTesteForm.cs has 728 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      using System;
                      using System.Collections.Generic;
                      using System.IO;
                      using System.Linq;
                      using System.Reflection;
                      Severity: Major
                      Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteForm.cs - About 1 day to fix

                        Method Core_Advanced_UpdateCaseFieldValue_UpdatesFieldValue has 336 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public async Task Core_Advanced_UpdateCaseFieldValue_UpdatesFieldValue()
                                {
                                    // Arrange
                        
                        
                        Severity: Major
                        Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTestAdvanced.cs - About 1 day to fix

                          File SqlControllerTestFieldValue.cs has 726 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          using System;
                          using System.Collections.Generic;
                          using System.Linq;
                          using System.Threading.Tasks;
                          using Microsoft.EntityFrameworkCore;

                            File OptionTranslationUTest.cs has 725 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            using System;
                            using System.Collections.Generic;
                            using System.Linq;
                            using System.Threading.Tasks;
                            using Microsoft.EntityFrameworkCore;
                            Severity: Major
                            Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs - About 1 day to fix

                              File 20190509074123_RefactoringidtoId.cs has 718 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              using Microsoft.EntityFrameworkCore.Metadata;
                              using Microsoft.EntityFrameworkCore.Migrations;
                              
                              namespace Microting.eForm.Migrations
                              {
                              Severity: Major
                              Found in eFormCore/Migrations/20190509074123_RefactoringidtoId.cs - About 1 day to fix

                                Method SQL_Check_CheckRead_ReturnsReplyElement has 315 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        [Test]
                                        public async Task SQL_Check_CheckRead_ReturnsReplyElement()
                                        {
                                            // Arrance
                                
                                
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language