microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method Core_Advanced_FieldRead_ReadsFieldId has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task Core_Advanced_FieldRead_ReadsFieldId()
        {
            // Arrance

Severity: Minor
Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTestAdvanced.cs - About 1 hr to fix

    Method SQL_Check_FieldRead_ReturnsField has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SQL_Check_FieldRead_ReturnsField()
            {
                // Arrance
    
    

      Method Core_Folders_UpdateFolder_DoesUpdateFolder has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public async Task Core_Folders_UpdateFolder_DoesUpdateFolder()
              {
                  // Arrange
      
      Severity: Minor
      Found in eFormSDK.Integration.Base.CoreTests/CoreTestFolders.cs - About 1 hr to fix

        Method siteSurveyConfiguration_Update_DoesUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [Test]
                public async Task siteSurveyConfiguration_Update_DoesUpdate()
                {
                    // Arrange
                    Random rnd = new Random();

          Method WorkerGetAll has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public async Task<List<WorkerDto>> WorkerGetAll(string workflowState, int? offSet, int? limit)
                  {
                      string methodName = "SqlController.WorkerGetAll";
                      try
                      {
          Severity: Minor
          Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

            Method CaseReadByMUId has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public async Task<CaseDto> CaseReadByMUId(int microtingUId)
                    {
                        string methodName = "SqlController.CaseReadByMUId";
                        try
                        {
            Severity: Minor
            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

              Method Workers_Update_DoesUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Workers_Update_DoesUpdate()
                      {
                          //Arrange
              
              
              Severity: Minor
              Found in eFormSDK.Base.Tests/WorkersUTest.cs - About 1 hr to fix

                Method FieldValidation has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private async Task<List<string>> FieldValidation(MainElement mainElement)
                        {
                            string methodName = "Core.FieldValidation";
                
                            Log.LogStandard(methodName, "called");
                Severity: Minor
                Found in eFormCore/Core.cs - About 1 hr to fix

                  Method Core_Case_CaseToJasperXml_ReturnsPath has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_Case_CaseToJasperXml_ReturnsPath()
                          {
                              // Arrange
                  
                  
                  Severity: Minor
                  Found in eFormSDK.Integration.Case.CoreTests/CoreTestCase.cs - About 1 hr to fix

                    Method EntityGroups_Update_DoesUpdate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public async Task EntityGroups_Update_DoesUpdate()
                            {
                                EntityGroup entityGroup = new EntityGroup
                                {
                    Severity: Minor
                    Found in eFormSDK.CheckLists.Tests/EntityGroupsUTest.cs - About 1 hr to fix

                      Method SiteTags_MultipleCreateAndDelete has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [Test]
                              public async Task SiteTags_MultipleCreateAndDelete()
                              {
                                  Random rnd = new Random();
                      
                      
                      Severity: Minor
                      Found in eFormSDK.Base.Tests/SiteTagsUTest.cs - About 1 hr to fix

                        Method QuestionSets_Delete_DoesSetWorkflowStateToRemoved has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public async Task QuestionSets_Delete_DoesSetWorkflowStateToRemoved()
                                {
                                    //Arrange
                        
                        
                        Severity: Minor
                        Found in eFormSDK.InSight.Tests/QuestionSetsUTest.cs - About 1 hr to fix

                          Method EntityItemUpdate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public async Task EntityItemUpdate(int id, string name, string description, string ownUuid, int displayIndex)
                                  {
                                      await using var dbContext = DbContextHelper.GetDbContext();
                                      Microting.eForm.Infrastructure.Data.Entities.EntityItem et =
                                          await dbContext.EntityItems.FirstOrDefaultAsync(x => x.Id == id);
                          Severity: Minor
                          Found in eFormCore/Core.cs - About 1 hr to fix

                            Method SiteWorkers_Create_DoesCreate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    [Test]
                                    public async Task SiteWorkers_Create_DoesCreate()
                                    {
                                        // Arrange
                            
                            
                            Severity: Minor
                            Found in eFormSDK.Base.Tests/SiteWorkersUTest.cs - About 1 hr to fix

                              Method SurveyConfigurations_Create_DoesCreate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      [Test]
                                      public async Task SurveyConfigurations_Create_DoesCreate()
                                      {
                                          //Arrange
                                          Random rnd = new Random();
                              Severity: Minor
                              Found in eFormSDK.InSight.Tests/SurveyConfigurationsUTest.cs - About 1 hr to fix

                                Method TemplateFromXml has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                                Open

                                        public async Task<MainElement> TemplateFromXml(string xmlString)
                                #pragma warning restore 1998
                                        {
                                            if (string.IsNullOrEmpty(xmlString))
                                                throw new ArgumentNullException("xmlString cannot be null or empty");
                                Severity: Minor
                                Found in eFormCore/Core.cs - About 1 hr 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 Up has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        protected override void Up(MigrationBuilder migrationBuilder)
                                        {
                                            migrationBuilder.CreateTable(
                                                name: "FolderTranslations",
                                                columns: table => new
                                Severity: Minor
                                Found in eFormCore/Migrations/20210407134630_AddingFolderTranslations.cs - About 1 hr to fix

                                  Method CaseReadFirstId has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          public async Task<int?> CaseReadFirstId(int? templateId, string workflowState)
                                          {
                                              string methodName = "SqlController.CaseReadFirstId";
                                              _log.LogStandard(methodName, "called");
                                              _log.LogVariable(methodName, nameof(templateId), templateId);
                                  Severity: Minor
                                  Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                    Method SettingCreateDefaults has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            public async Task<bool> SettingCreateDefaults()
                                            {
                                                string methodName = "SqlController.SettingCreateDefaults";
                                    
                                                WriteDebugConsoleLogEntry(new LogEntry(2, methodName, "called"));
                                    Severity: Minor
                                    Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                                      Method Handle has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              public async Task Handle(TranscriptionCompleted message)
                                              {
                                                  try
                                                  {
                                                      FieldValue fv = await sqlController.GetFieldValueByTranscriptionId(message.MicrotringUUID);
                                      Severity: Minor
                                      Found in eFormCore/Handlers/TranscriptionCompletedHandler.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language