microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Identical blocks of code found in 10 locations. Consider refactoring.
Open

            modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.FolderTranslation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");
eFormCore/Migrations/20210609072417_AddingLinkingOfSitesAndEntities.Designer.cs on lines 1994..2035
eFormCore/Migrations/20211014105943_CLAttributes.Designer.cs on lines 2024..2065
eFormCore/Migrations/20211108111024_AddingIsArchivedToCases.Designer.cs on lines 2030..2071
eFormCore/Migrations/20211116085744_AddingDoneAtEditable.Designer.cs on lines 2050..2091
eFormCore/Migrations/20220207094729_AddingIsLockedToSiteUnitWorkers.Designer.cs on lines 2050..2091
eFormCore/Migrations/20221016081344_AddingIsActiveToLanguage.Designer.cs on lines 2050..2091
eFormCore/Migrations/20221129082337_AddingReceivedByServerAtToCases.Designer.cs on lines 2056..2097
eFormCore/Migrations/20230506062507_AddingInitialsToWorkers.Designer.cs on lines 2057..2098
eFormCore/Migrations/20230607084834_AddingOriginalFileLocationToUploadedData.Designer.cs on lines 2057..2098

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

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 10 locations. Consider refactoring.
Open

            modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.FolderTranslation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");
eFormCore/Migrations/20210609072417_AddingLinkingOfSitesAndEntities.Designer.cs on lines 1994..2035
eFormCore/Migrations/20210730085329_AddingDefaultValueToFieldTranslations.Designer.cs on lines 2006..2047
eFormCore/Migrations/20211014105943_CLAttributes.Designer.cs on lines 2024..2065
eFormCore/Migrations/20211108111024_AddingIsArchivedToCases.Designer.cs on lines 2030..2071
eFormCore/Migrations/20211116085744_AddingDoneAtEditable.Designer.cs on lines 2050..2091
eFormCore/Migrations/20220207094729_AddingIsLockedToSiteUnitWorkers.Designer.cs on lines 2050..2091
eFormCore/Migrations/20221016081344_AddingIsActiveToLanguage.Designer.cs on lines 2050..2091
eFormCore/Migrations/20230506062507_AddingInitialsToWorkers.Designer.cs on lines 2057..2098
eFormCore/Migrations/20230607084834_AddingOriginalFileLocationToUploadedData.Designer.cs on lines 2057..2098

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

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 10 locations. Consider refactoring.
Open

            modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.FolderTranslation", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");
eFormCore/Migrations/20210609072417_AddingLinkingOfSitesAndEntities.Designer.cs on lines 1994..2035
eFormCore/Migrations/20210730085329_AddingDefaultValueToFieldTranslations.Designer.cs on lines 2006..2047
eFormCore/Migrations/20211014105943_CLAttributes.Designer.cs on lines 2024..2065
eFormCore/Migrations/20211108111024_AddingIsArchivedToCases.Designer.cs on lines 2030..2071
eFormCore/Migrations/20211116085744_AddingDoneAtEditable.Designer.cs on lines 2050..2091
eFormCore/Migrations/20221016081344_AddingIsActiveToLanguage.Designer.cs on lines 2050..2091
eFormCore/Migrations/20221129082337_AddingReceivedByServerAtToCases.Designer.cs on lines 2056..2097
eFormCore/Migrations/20230506062507_AddingInitialsToWorkers.Designer.cs on lines 2057..2098
eFormCore/Migrations/20230607084834_AddingOriginalFileLocationToUploadedData.Designer.cs on lines 2057..2098

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

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

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

    Method SQL_SiteWorker_SiteWorkerRead_ReadsSiteWorker has 138 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            public async Task SQL_SiteWorker_SiteWorkerRead_ReadsSiteWorker()
            {
    
                // Arrance
    Severity: Major
    Found in eFormSDK.Integration.Tests/SqlControllerTestSiteWorker.cs - About 5 hrs to fix

      Method GetExtraFieldValues has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private async Task<string> GetExtraFieldValues(int caseId, string customPathForUploadedData, Language language)
              {
                  var token = await GetSdkSetting(Settings.token);
                  var db = DbContextHelper.GetDbContext();
                  StringBuilder jasperFieldXml = new StringBuilder();
      Severity: Major
      Found in eFormCore/Core.cs - About 5 hrs to fix

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

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

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

        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: "taggings",
                        columns: table => new
                        {
                            id = table.Column<int>(nullable: false)
        Severity: Major
        Found in eFormCore/Migrations/20180810124416_InitialCreate.cs and 1 other location - About 5 hrs to fix
        eFormCore/Migrations/20180810124416_InitialCreate.cs on lines 754..783

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

        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: "QuestionTranslations",
                        columns: table => new
                        {
                            Id = table.Column<int>(nullable: false)
        eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.cs on lines 77..106

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

        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: "OptionTranslations",
                        columns: table => new
                        {
                            Id = table.Column<int>(nullable: false)
        eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.cs on lines 128..157

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

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

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

          Method SQL_Worker_WorkerDelete_DeletesWorker has 136 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method SQL_SiteWorker_SiteWorkerUpdate_UpdatesSiteWorker has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task SQL_SiteWorker_SiteWorkerUpdate_UpdatesSiteWorker()
                    {
            
                        // Arrance
            Severity: Major
            Found in eFormSDK.Integration.Tests/SqlControllerTestSiteWorker.cs - About 5 hrs to fix

              Method SQL_Worker_WorkerNameRead_ReadsName has 136 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method SQL_Worker_WorkerUpdate_UpdatesWorker has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method SQL_SiteWorker_SiteWorkerCreate_ReturnsID has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task SQL_SiteWorker_SiteWorkerCreate_ReturnsID()
                          {
                  
                              // Arrance
                  Severity: Major
                  Found in eFormSDK.Integration.Tests/SqlControllerTestSiteWorker.cs - About 5 hrs to fix

                    Method SQL_SiteWorker_SiteWorkerDelete_DeletesSiteWorker has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public async Task SQL_SiteWorker_SiteWorkerDelete_DeletesSiteWorker()
                            {
                    
                                // Arrance
                    Severity: Major
                    Found in eFormSDK.Integration.Tests/SqlControllerTestSiteWorker.cs - About 5 hrs to fix

                      Method TemplateItemReadAll has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
                      Open

                              public async Task<List<Template_Dto>> TemplateItemReadAll(bool includeRemoved, string siteWorkflowState,
                                  string searchKey, bool descendingSort, string sortParameter, List<int> tagIds, TimeZoneInfo timeZoneInfo,
                                  Language language)
                              {
                                  string methodName = "SqlController.TemplateItemReadAll";
                      Severity: Minor
                      Found in eFormCore/Infrastructure/SqlController.cs - About 5 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

                      Identical blocks of code found in 8 locations. Consider refactoring.
                      Open

                                  modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.answer_versions", b =>
                                      {
                                          b.Property<int>("Id")
                                              .ValueGeneratedOnAdd()
                                              .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                      eFormCore/Migrations/20200120093951_CleanupInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200120171433_AddingMicrotingUidToInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200122103229_ChangingValueToBeStringForAnswerValue.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200222140656_AddinDisplayIndexToOptions.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200224084023_AddingAttributesToUnits.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200224092512_AddingMoreAttributesToUnits.Designer.cs on lines 101..141

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

                      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 8 locations. Consider refactoring.
                      Open

                                  modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.answer_versions", b =>
                                      {
                                          b.Property<int>("Id")
                                              .ValueGeneratedOnAdd()
                                              .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
                      eFormCore/Migrations/20200120093951_CleanupInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200120171433_AddingMicrotingUidToInSight.Designer.cs on lines 125..165
                      eFormCore/Migrations/20200222140656_AddinDisplayIndexToOptions.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200224084023_AddingAttributesToUnits.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200224092512_AddingMoreAttributesToUnits.Designer.cs on lines 101..141
                      eFormCore/Migrations/20200226182616_MakingNextQuestionIdNullable.Designer.cs on lines 101..141

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

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language