microting/eform-sdk-dotnet

View on GitHub

Showing 3,203 of 3,219 total issues

Method question_Create_DoesCreate_QuestionSetFalse_ValidDisplayBackButtonEnabledTrue has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                [Test]
        public async Task question_Create_DoesCreate_QuestionSetFalse_ValidDisplayBackButtonEnabledTrue()
        {
            // Arrange
            string name = Guid.NewGuid().ToString();
Severity: Major
Found in eFormSDK.Integration.Tests/SqlControllerTestQuestion.cs - About 2 hrs to fix

    Method question_Create_DoesCreate_QuestionSetFalse_PrioritisedValidDisplayImageTrue has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                                    [Test]
            public async Task question_Create_DoesCreate_QuestionSetFalse_PrioritisedValidDisplayImageTrue()
            {
                // Arrange
                string name = Guid.NewGuid().ToString();
    Severity: Major
    Found in eFormSDK.Integration.Tests/SqlControllerTestQuestion.cs - About 2 hrs to fix

      Method InsertImages has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static void InsertImages(WordprocessingDocument wordDoc,
                  List<KeyValuePair<string, List<string>>> pictures)
              {
                  string currentHeader = "";
                  List<Paragraph> foundEntriesToClearText = new List<Paragraph>();
      Severity: Major
      Found in eFormCore/Helpers/ReportHelper.cs - About 2 hrs to fix

        Method Close has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public async Task<bool> Close()
        #pragma warning restore 1998
                {
                    string methodName = "Core.Close";
                    Log.LogStandard(methodName, "Close called");
        Severity: Major
        Found in eFormCore/Core.cs - About 2 hrs to fix

          Method EntityItemCreate has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private async Task<EntityItem> EntityItemCreate(int entitItemGroupId, string name, string description,
                      string ownUuid, int displayIndex)
                  {
                      EntityGroup eg = await _sqlController.EntityGroupRead(entitItemGroupId).ConfigureAwait(false);
                      EntityItem et = await _sqlController.EntityItemRead(entitItemGroupId, name, description)
          Severity: Major
          Found in eFormCore/Core.cs - About 2 hrs to fix

            Method SiteWorkers_Delete_DoesSetWorkflowStateToRemoved has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

              using Microsoft.EntityFrameworkCore.Migrations;
              
              namespace Microting.eForm.Migrations
              {
                  public partial class AddingExcelExportEnabledToCheckList : Migration
              eFormCore/Migrations/20200222140656_AddinDisplayIndexToOptions.cs on lines 1..34

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

              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

              using Microsoft.EntityFrameworkCore.Migrations;
              
              namespace Microting.eForm.Migrations
              {
                  public partial class AddinDisplayIndexToOptions : Migration
              eFormCore/Migrations/20200620171527_AddingExcelExportEnabledToCheckList.cs on lines 1..34

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

              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

                          Unit unit = new Unit
                          {
                              CustomerNo = rnd.Next(1, 255),
                              MicrotingUid = rnd.Next(1, 255),
                              OtpCode = rnd.Next(1, 255),
              Severity: Major
              Found in eFormSDK.Base.Tests/UnitsUTest.cs and 2 other locations - About 2 hrs to fix
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 55..67
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 133..145

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

              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

                          Unit unit = new Unit
                          {
                              CustomerNo = rnd.Next(1, 255),
                              MicrotingUid = rnd.Next(1, 255),
                              OtpCode = rnd.Next(1, 255),
              Severity: Major
              Found in eFormSDK.Base.Tests/UnitsUTest.cs and 2 other locations - About 2 hrs to fix
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 133..145
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 240..252

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

              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

                          Unit unit = new Unit
                          {
                              CustomerNo = rnd.Next(1, 255),
                              MicrotingUid = rnd.Next(1, 255),
                              OtpCode = rnd.Next(1, 255),
              Severity: Major
              Found in eFormSDK.Base.Tests/UnitsUTest.cs and 2 other locations - About 2 hrs to fix
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 55..67
              eFormSDK.Base.Tests/UnitsUTest.cs on lines 240..252

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

              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 Tools.cs has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              using System.Collections.Generic;
              using System.Diagnostics;
              using System.Linq;
              using System.Runtime.CompilerServices;
              Severity: Minor
              Found in eFormCore/Tools.cs - About 2 hrs to fix

                Method SubscriberThread has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
                Open

                        private void SubscriberThread()
                        {
                            var token = _sqlController.SettingRead(Settings.token).GetAwaiter().GetResult();
                            if (token != "UNIT_TEST___________________L:32" && token != "abc1234567890abc1234567890abcdef")
                            {
                Severity: Minor
                Found in eFormCore/Services/Subscriber.cs - About 2 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 Core_Folders_CreateSubFolder_DoesCreateSubFolder has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task Core_Folders_CreateSubFolder_DoesCreateSubFolder()
                        {
                            // Arrange
                
                Severity: Major
                Found in eFormSDK.Integration.Base.CoreTests/CoreTestFolders.cs - About 2 hrs to fix

                  Method SQL_answers_Create_DoesCreate_UTCAdjustedTrue has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method CaseCreate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public async Task<int> CaseCreate(int checkListId, int siteUId, int? microtingUId, int? microtingCheckId,
                                string caseUId, string custom, DateTime createdAt, int? folderId)
                            {
                                string methodName = "SqlController.CaseCreate";
                                _log.LogStandard(methodName, "called");
                    Severity: Major
                    Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                      Method SetAutoIncrementforTables has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private void SetAutoIncrementforTables(MigrationBuilder migrationBuilder)
                              {
                                  List<string> modelNames = new List<string>();
                                  modelNames.Add("case_versions");
                                  modelNames.Add("cases");
                      Severity: Major
                      Found in eFormCore/Migrations/20180810124416_InitialCreate.cs - About 2 hrs to fix

                        Method FolderUpdate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public async Task FolderUpdate(int id, List<CommonTranslationsModel> translations, int? parentId)
                                {
                                    string methodName = "Core.FolderUpdate";
                                    try
                                    {
                        Severity: Major
                        Found in eFormCore/Core.cs - About 2 hrs to fix

                          Method QuestionSets_Update_DoesUpdate has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method GetAllQuestionSets has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public async Task<bool> GetAllQuestionSets()
                                    {
                                        var parsedData = JObject.Parse(await _communicator.GetAllQuestionSets().ConfigureAwait(false));
                            
                                        if (!parsedData.HasValues)
                            Severity: Major
                            Found in eFormCore/Core.cs - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language