microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

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

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

                              case Constants.Constants.FieldTypes.ShowPdf:
                                  lstDataItem.Add(new ShowPdf(_t.Int(field.Id), _t.Bool(field.Mandatory), _t.Bool(field.ReadOnly),
                                      fieldTranslation.Text, fieldTranslation.Description, field.Color,
                                      _t.Int(field.DisplayIndex), _t.Bool(field.Dummy),
                                      fieldTranslation.DefaultValue));
          Severity: Major
          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
          eFormCore/Infrastructure/SqlController.cs on lines 7218..7223

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

          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

                  [Test]
                  public async Task Core_EntitySelectItemCreate_CreatesEntitySelectItem()
                  {
                      // Arrance
                      EntityGroup eG1 = await testHelpers.CreateEntityGroup("microtingUIdC1", "EntityGroup1",
          Severity: Major
          Found in eFormSDK.Integration.Base.CoreTests/CoreTestEntity.cs and 1 other location - About 1 hr to fix
          eFormSDK.Integration.Base.CoreTests/CoreTestEntity.cs on lines 2530..2544

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

          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

                  [Test]
                  public async Task Core_EntitySearchItemCreate_CreatesEntitySearchItem()
                  {
                      // Arrance
                      EntityGroup eG1 = await testHelpers.CreateEntityGroup("microtingUIdC1", "EntityGroup1",
          Severity: Major
          Found in eFormSDK.Integration.Base.CoreTests/CoreTestEntity.cs and 1 other location - About 1 hr to fix
          eFormSDK.Integration.Base.CoreTests/CoreTestEntity.cs on lines 2584..2598

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

          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

                              case Constants.Constants.FieldTypes.SaveButton:
                                  lstDataItem.Add(new SaveButton(_t.Int(field.Id), _t.Bool(field.Mandatory),
                                      _t.Bool(field.ReadOnly), fieldTranslation.Text, fieldTranslation.Description, field.Color,
                                      _t.Int(field.DisplayIndex), _t.Bool(field.Dummy),
                                      fieldTranslation.DefaultValue));
          Severity: Major
          Found in eFormCore/Infrastructure/SqlController.cs and 1 other location - About 1 hr to fix
          eFormCore/Infrastructure/SqlController.cs on lines 7225..7230

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

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

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

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

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

          Refactorings

          Further Reading

          Method 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 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 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 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 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 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 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 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 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 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

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

                                      public async Task<int> FolderCreate(List<CommonTranslationsModel> translations, int? parentId)
                                      {
                                          string methodName = "Core.FolderCreate";
                                          try
                                          {
                              Severity: Minor
                              Found in eFormCore/Core.cs - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language