microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Method Down has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_field_values_uploaded_datas_UploadedDatasId",
                table: "field_values");
Severity: Major
Found in eFormCore/Migrations/20201220194822_FixingTableColumnNames.cs - About 2 hrs to fix

    Method SurveyConfigurations_Update_DoesUpdate has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SurveyConfigurations_Update_DoesUpdate()
            {
                //Arrange
                Random rnd = new Random();
    Severity: Major
    Found in eFormSDK.InSight.Tests/SurveyConfigurationsUTest.cs - About 2 hrs to fix

      Method OptionTranslation_Create_DoesCreate_WO_MicrotingUid has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

                private static void SearchAndReplaceHeaders(WordprocessingDocument wordDoc,
                    SortedDictionary<string, string> valuesToReplace)
                {
                    WriteDebugConsoleLogEntry(new LogEntry(2, "ReportHelper", "SearchAndReplaceHeaders called"));
                    foreach (HeaderPart headerPart in wordDoc.MainDocumentPart.HeaderParts)
        Severity: Major
        Found in eFormCore/Helpers/ReportHelper.cs and 1 other location - About 2 hrs to fix
        eFormCore/Helpers/ReportHelper.cs on lines 99..121

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

        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 SearchAndReplaceFooters(WordprocessingDocument wordDoc,
                    SortedDictionary<string, string> valuesToReplace)
                {
                    WriteDebugConsoleLogEntry(new LogEntry(2, "ReportHelper", "SearchAndReplaceFooters called"));
                    foreach (FooterPart footerPart in wordDoc.MainDocumentPart.FooterParts)
        Severity: Major
        Found in eFormCore/Helpers/ReportHelper.cs and 1 other location - About 2 hrs to fix
        eFormCore/Helpers/ReportHelper.cs on lines 54..76

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

        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

        File SqlControllerTestUploadedData.cs has 276 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;

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

                  protected override void Up(MigrationBuilder migrationBuilder)
                  {
                      migrationBuilder.CreateTable(
                          name: "ExtraFieldValues",
                          columns: table => new
          Severity: Major
          Found in eFormCore/Migrations/20210405153325_AddingExtraFieldValues.cs - About 2 hrs to fix

            Method GetJasperFieldValue has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private async Task<string> GetJasperFieldValue(Field field, FieldValue answer, string customPathForUploadedData)
                    {
                        var token = await GetSdkSetting(Settings.token);
                        StringBuilder jasperFieldXml = new StringBuilder();
                        string latitude = answer.Latitude;
            Severity: Major
            Found in eFormCore/Core.cs - About 2 hrs to fix

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

                          migrationBuilder.CreateTable(
                              name: "logs",
                              columns: table => new
                              {
                                  id = table.Column<int>(nullable: false)
              Severity: Major
              Found in eFormCore/Migrations/20180810124416_InitialCreate.cs and 1 other location - About 2 hrs to fix
              eFormCore/Migrations/20180810124416_InitialCreate.cs on lines 376..390

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

              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

                          migrationBuilder.CreateTable(
                              name: "log_exceptions",
                              columns: table => new
                              {
                                  id = table.Column<int>(nullable: false)
              Severity: Major
              Found in eFormCore/Migrations/20180810124416_InitialCreate.cs and 1 other location - About 2 hrs to fix
              eFormCore/Migrations/20180810124416_InitialCreate.cs on lines 392..406

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

              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

                                      {
                                          lastAnswer = await db.Answers.OrderByDescending(x => x.Id)
                                              .FirstOrDefaultAsync(x =>
                                                  x.QuestionSetId == questionSetId
                                                  && x.WorkflowState != Constants.WorkflowStates.PreCreated
              Severity: Major
              Found in eFormCore/Core.cs and 1 other location - About 2 hrs to fix
              eFormCore/Core.cs on lines 4314..4332

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

              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

                                      {
                                          lastAnswer = await db.Answers.OrderByDescending(x => x.Id)
                                              .FirstOrDefaultAsync(x =>
                                                  x.QuestionSetId == questionSetId
                                                  && x.WorkflowState != Constants.WorkflowStates.PreCreated
              Severity: Major
              Found in eFormCore/Core.cs and 1 other location - About 2 hrs to fix
              eFormCore/Core.cs on lines 4279..4297

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

              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 SQL_PostCase_CaseReadFirstId has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task SQL_PostCase_CaseReadFirstId()
                      {
                          // Arrance
                          Random rnd = new Random();
              Severity: Major
              Found in eFormSDK.Integration.Case.SqlControllerTests/SqlControllerTestCase.cs - About 2 hrs to fix

                Method options_Delete_DoesDelete has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task options_Delete_DoesDelete()
                        {        
                            // Arrange
                            #region QuestionSet
                Severity: Major
                Found in eFormSDK.Integration.Tests/SqlControllerTestOptions.cs - About 2 hrs to fix

                  Method LanguageQuestionSet_Update_DoesUpdate_W_MicrotingUid has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task LanguageQuestionSet_Update_DoesUpdate_W_MicrotingUid()
                          {
                              //Assert
                              Random rnd = new Random();
                  Severity: Major
                  Found in eFormSDK.InSight.Tests/LanguageQuestionSetUTest.cs - About 2 hrs to fix

                    Method CasesToCsv has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public async Task<string> CasesToCsv(int templateId, DateTime? start, DateTime? end, string pathAndName,
                                string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
                                CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool gpsCoordinates,
                                bool includeCheckListText)
                            {
                    Severity: Major
                    Found in eFormCore/Core.cs - About 2 hrs to fix

                      Method LanguageQuestionSet_Update_DoesUpdate_W_MicrotingUid_RemovesUid has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [Test]
                              public async Task LanguageQuestionSet_Update_DoesUpdate_W_MicrotingUid_RemovesUid()
                              {
                                  //Assert
                                  Random rnd = new Random();
                      Severity: Major
                      Found in eFormSDK.InSight.Tests/LanguageQuestionSetUTest.cs - About 2 hrs to fix

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

                                protected override void Up(MigrationBuilder migrationBuilder)
                                {
                                    migrationBuilder.DropPrimaryKey(
                                        name: "PK_site_survey_configuraions",
                                        table: "site_survey_configuraions");
                        eFormCore/Migrations/20190318122928_FixingNamingOfSurveyConfigurationSites.cs on lines 65..97

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

                        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

                                protected override void Down(MigrationBuilder migrationBuilder)
                                {
                                    migrationBuilder.DropPrimaryKey(
                                        name: "PK_site_survey_configurations",
                                        table: "site_survey_configurations");
                        eFormCore/Migrations/20190318122928_FixingNamingOfSurveyConfigurationSites.cs on lines 31..63

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

                        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

                        File Field.cs has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        using System;
                        using System.Collections.Generic;
                        using System.ComponentModel.DataAnnotations;
                        using System.ComponentModel.DataAnnotations.Schema;
                        using System.Linq;
                        Severity: Minor
                        Found in eFormCore/Infrastructure/Data/Entities/Field.cs - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language