microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Method Answer_Delete_DoesSetWorkflowStateToRemoved has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task Answer_Delete_DoesSetWorkflowStateToRemoved()
        {
            //Arrange

Severity: Major
Found in eFormSDK.InSight.Tests/AnswersUTest.cs - About 4 hrs to fix

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

                modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.notifications", b =>
                    {
                        b.Property<int>("Id")
                            .ValueGeneratedOnAdd()
                            .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
    eFormCore/Migrations/20190828074017_AddingMissingClasses.Designer.cs on lines 1288..1320

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

    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

                modelBuilder.Entity("Microting.eForm.Infrastructure.Data.Entities.notifications", b =>
                    {
                        b.Property<int>("Id")
                            .ValueGeneratedOnAdd()
                            .HasAnnotation(autoIDGenStrategy, autoIDGenStrategyValue);
    eFormCore/Migrations/20190828054730_AddingNewVersionClasses.Designer.cs on lines 1252..1284

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

    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 GetExtraFieldValues has a Cognitive Complexity of 44 (exceeds 20 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: Minor
    Found in eFormCore/Core.cs - About 4 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

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

                migrationBuilder.CreateTable(
                    name: "OptionTranslationVersions",
                    columns: table => new
                    {
                        Id = table.Column<int>(nullable: false)
    eFormCore/Migrations/20190315092242_AddingModelseForInsight.cs on lines 68..86
    eFormCore/Migrations/20190408081151_AddingFolders.cs on lines 47..65

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

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

                migrationBuilder.CreateTable(
                    name: "answer_values",
                    columns: table => new
                    {
                        id = table.Column<int>(nullable: false)
    eFormCore/Migrations/20190408081151_AddingFolders.cs on lines 47..65
    eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.cs on lines 108..126

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

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

                migrationBuilder.CreateTable(
                    name: "folder_versions",
                    columns: table => new
                    {
                        id = table.Column<int>(nullable: false)
    Severity: Major
    Found in eFormCore/Migrations/20190408081151_AddingFolders.cs and 2 other locations - About 4 hrs to fix
    eFormCore/Migrations/20190315092242_AddingModelseForInsight.cs on lines 68..86
    eFormCore/Migrations/20200120164857_AddingTranslationsToInSight.cs on lines 108..126

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

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

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

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

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

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

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

      File Response.cs has 341 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Method SQL_answerValues_Delete_DoesDelete has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

                  public override async Task DoSetup()
                  {
                      DbContextHelper dbContextHelper = new DbContextHelper(ConnectionString);
                      SqlController sql = new SqlController(dbContextHelper);
                      await sql.SettingUpdate(Settings.token, "abc1234567890abc1234567890abcdef");
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSiteWorker.cs on lines 26..43
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestUnit.cs on lines 27..44

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

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

                  public override async Task DoSetup()
                  {
                      DbContextHelper dbContextHelper = new DbContextHelper(ConnectionString);
                      SqlController sql = new SqlController(dbContextHelper);
                      await sql.SettingUpdate(Settings.token, "abc1234567890abc1234567890abcdef");
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSite.cs on lines 26..43
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSiteWorker.cs on lines 26..43

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

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

                  public override async Task DoSetup()
                  {
                      DbContextHelper dbContextHelper = new DbContextHelper(ConnectionString);
                      SqlController sql = new SqlController(dbContextHelper);
                      await sql.SettingUpdate(Settings.token, "abc1234567890abc1234567890abcdef");
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSite.cs on lines 26..43
          eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestUnit.cs on lines 27..44

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

          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 GetAnswersForQuestionSet has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
          Open

                  public async Task GetAnswersForQuestionSet(int? apiQuestionSetId)
                  {
                      if (apiQuestionSetId == null)
                          return;
          
          
          Severity: Minor
          Found in eFormCore/Core.cs - About 4 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_Check_CheckListValueStatusUpdate_UpdatesCheckListValues has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method SQL_Site_SiteRead_ReadsSite has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method SQL_answerValues_Create_DoesCreate has 102 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

                        [Test]
                        public async Task SQL_Notification_NewNotificationCreateRetrievedForm_DoesStoreNotification()
                        {
                            // Arrance
                            Random rnd = new Random();
                eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestNotification.cs on lines 92..111

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

                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