microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method GetAnswersForQuestionSet has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public async Task GetAnswersForQuestionSet(int? apiQuestionSetId)
        {
            if (apiQuestionSetId == null)
                return;

Severity: Major
Found in eFormCore/Core.cs - About 3 hrs to fix

    Method UploadedData_Update_DoesUpdate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task UploadedData_Update_DoesUpdate()
            {
                //Arrange
    
    
    Severity: Major
    Found in eFormSDK.CheckLists.Tests/UploadedDataUTest.cs - About 3 hrs to fix

      Method SQL_answers_Update_DoesUpdate_UTCAdjustedFalse has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public async Task SQL_answers_Update_DoesUpdate_UTCAdjustedFalse()
              {
                  // Arrange
                  Random rnd = new Random();
      Severity: Major
      Found in eFormSDK.Integration.Tests/SqlControllerTestAnswer.cs - About 3 hrs to fix

        Method SiteCreate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public async Task<SiteDto> SiteCreate(string name, string userFirstName, string userLastName, string userEmail,
                    string languageCode)
                {
                    string methodName = "Core.SiteCreate";
                    await using var db = DbContextHelper.GetDbContext();
        Severity: Major
        Found in eFormCore/Core.cs - About 3 hrs to fix

          Method Core_eForm_SimplePictureAndSignatureFormCreateInDB_ReturnseFormId has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  [Test]
                  public async Task Core_eForm_SimplePictureAndSignatureFormCreateInDB_ReturnseFormId()
                  {
                      // Arrange
                      string xmlstring = @"
          Severity: Major
          Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 3 hrs to fix

            Method GetAllSurveyConfigurations has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
            Open

                    public async Task<bool> GetAllSurveyConfigurations()
                    {
                        var parsedData = JObject.Parse(await _communicator.GetAllSurveyConfigurations().ConfigureAwait(false));
            
                        var jsonSerializerSettings = new JsonSerializerSettings
            Severity: Minor
            Found in eFormCore/Core.cs - About 3 hrs 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 CheckStatusByMicrotingUid has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
            Open

                    public async Task<bool> CheckStatusByMicrotingUid(int microtingUid)
                    {
                        string methodName = "Core.CheckStatusByMicrotingUid";
                        List<CaseDto> lstCase = new List<CaseDto>();
                        MainElement mainElement = new MainElement();
            Severity: Minor
            Found in eFormCore/Core.cs - About 3 hrs 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 SQL_answers_Update_DoesUpdate_UTCAdjustedTrue has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task SQL_answers_Update_DoesUpdate_UTCAdjustedTrue()
                    {
                        // Arrange
                        Random rnd = new Random();
            Severity: Major
            Found in eFormSDK.Integration.Tests/SqlControllerTestAnswer.cs - About 3 hrs to fix

              File MainElement.cs has 301 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              using System.Collections.Generic;
              using System.IO;
              using System.Text;
              using System.Xml.Serialization;
              Severity: Minor
              Found in eFormCore/Infrastructure/Models/MainElement.cs - About 3 hrs to fix

                Method Core_Folders_UpdateFolder_DoesUpdateSingleFolderTranslation has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task Core_Folders_UpdateFolder_DoesUpdateSingleFolderTranslation()
                        {
                            // Arrange
                
                Severity: Major
                Found in eFormSDK.Integration.Base.CoreTests/CoreTestFolders.cs - About 3 hrs to fix

                  Method GenerateDataSetFromCasesSubSet has 80 lines of code (exceeds 25 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: Major
                  Found in eFormCore/Core.cs - About 3 hrs to fix

                    Method Units_Update_DoesUpdate has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public async Task Units_Update_DoesUpdate()
                            {
                                //Arrange
                    
                    
                    Severity: Major
                    Found in eFormSDK.Base.Tests/UnitsUTest.cs - About 3 hrs to fix

                      Method Core_SiteWorkers_Advanced_SiteWorkerRead_ReadsSiteWorker has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method Core_eFormSimpleNumberFormCreateInDB_ReturnseFormId has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public async Task Core_eFormSimpleNumberFormCreateInDB_ReturnseFormId()
                                {
                                    string xmlstring = @"
                                        <?xml version='1.0' encoding='UTF-8'?>
                        Severity: Major
                        Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 3 hrs to fix

                          Method Core_Case_CaseRead_ReadsCase has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  [Test]
                                  public async Task Core_Case_CaseRead_ReadsCase()
                                  {
                                      // Arrange
                                      #region Arrance
                          Severity: Major
                          Found in eFormSDK.Integration.Tests/CoreTestCase.cs - About 3 hrs to fix

                            Method XmlToClass has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public Response XmlToClass(string xmlStr)
                                    {
                                        try
                                        {
                                            ResponseTypes rType = ResponseTypes.Invalid;
                            Severity: Major
                            Found in eFormCore/Infrastructure/Models/reply/Response.cs - About 3 hrs to fix

                              Method InsertPicture has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      public static void InsertPicture(List<string> values, WordprocessingDocument wordDoc,
                                          Paragraph paragraph = null)
                                      {
                                          MainDocumentPart mainPart = wordDoc.MainDocumentPart;
                                          ImagePart imagePart = mainPart.AddImagePart(ImagePartType.Jpeg);
                              Severity: Major
                              Found in eFormCore/Helpers/ReportHelper.cs - About 3 hrs to fix

                                Method OptionTranslation_Delete_DoesDelete has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        [Test]
                                        public async Task OptionTranslation_Delete_DoesDelete()
                                        {
                                            //Arrange
                                
                                
                                Severity: Major
                                Found in eFormSDK.InSight.Tests/OptionTranslationUTest.cs - About 3 hrs to fix

                                  Method Core_eForm_SimpleCommenteFormCreateInDB_ReturnseFormId has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          [Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
                                          public async Task Core_eForm_SimpleCommenteFormCreateInDB_ReturnseFormId()
                                          {
                                              // Arrange
                                              string xmlstring = @"
                                  Severity: Major
                                  Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTesteFormCreateInDB.cs - About 3 hrs to fix

                                    Method TemplateSetTags has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
                                            {
                                                string methodName = "SqlController.TemplateSetTags";
                                                try
                                                {
                                    Severity: Minor
                                    Found in eFormCore/Infrastructure/SqlController.cs - About 3 hrs 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language