microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method SQL_Check_FieldValueReadList_ReturnsList has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        [Test]
        public async Task SQL_Check_FieldValueReadList_ReturnsList()
        {
            // Arrance

    Class CoreTestCase has 30 methods (exceeds 20 allowed). Consider refactoring.
    Open

        [TestFixture]
        public class CoreTestCase : DbTestFixture
        {
            private Core sut;
            private TestHelpers testHelpers;
    Severity: Minor
    Found in eFormSDK.Integration.Tests/CoreTestCase.cs - About 3 hrs to fix

      Method CreateField has 29 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              public async Task<Field> CreateField(short? barcodeEnabled, string barcodeType, CheckList checkList,
                  string color, string custom, int? decimalCount, string defaultValue, string description, int? displayIndex,
                  short? dummy, FieldType ft, short? geolocationEnabled, short? geolocationForced, short? geolocationHidden,
                  short? isNum, string label, short? mandatory, int maxLength, string maxValue, string minValue, short? multi,
                  short? optional, string queryType, short? readOnly, short? selected, short? split, short? stopOnSave,
      Severity: Major
      Found in eFormCore/Helpers/TestHelpers.cs - About 3 hrs to fix

        Method Core_Folders_UpdateFolder_DoesUpdateFolderWithTranslations has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method ClearDb has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private async Task ClearDb()
                  {
                      Console.WriteLine($"Starting ClearDb {DateTime.Now.ToString(CultureInfo.CurrentCulture)}");
          
                      List<string> modelNames = new List<string>();
          Severity: Major
          Found in eFormSDK.Integration.Tests/DbTestFixture.cs - About 3 hrs to fix

            Method AddDefaultLanguages has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
            Open

                    public static async Task AddDefaultLanguages(MicrotingDbContext dbContext)
                    {
            
                        if (dbContext.Languages.FirstOrDefault(x => x.Name == "Danish") != null)
                        {
            Severity: Minor
            Found in eFormCore/Infrastructure/Data/Entities/Language.cs - About 3 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_Unit_UnitGetAll_ReturnsAllUnits has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public async Task SQL_Unit_UnitGetAll_ReturnsAllUnits()
                    {
                        // Arrance
            
            
            Severity: Major
            Found in eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestUnit.cs - About 3 hrs to fix

              Method SQL_Check_FieldValueUpdate_UpdatesFieldValue has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task SQL_Check_FieldValueUpdate_UpdatesFieldValue()
                      {
                          // Arrance
              
              

                Method CheckListSites_Update_DoesUpdate has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        [Test]
                        public async Task CheckListSites_Update_DoesUpdate()
                        {
                            //Arrange
                
                
                Severity: Major
                Found in eFormSDK.CheckLists.Tests/CheckListSitesUTest.cs - About 3 hrs to fix

                  Method Core_Advanced_FieldValueReadList_ReturnsList has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          [Test]
                          public async Task Core_Advanced_FieldValueReadList_ReturnsList()
                          {
                              // Arrance
                  
                  
                  Severity: Major
                  Found in eFormSDK.Integration.CheckLists.CoreTests/CoreTestAdvanced.cs - About 3 hrs to fix

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

                            protected override void Up(MigrationBuilder migrationBuilder)
                            {
                                migrationBuilder.AddColumn<string>(
                                    name: "LastIp",
                                    table: "units",
                    Severity: Major
                    Found in eFormCore/Migrations/20200224092512_AddingMoreAttributesToUnits.cs - About 3 hrs to fix

                      Method CheckStatusByMicrotingUid has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public async Task<bool> CheckStatusByMicrotingUid(int microtingUid)
                              {
                                  string methodName = "Core.CheckStatusByMicrotingUid";
                                  List<CaseDto> lstCase = new List<CaseDto>();
                                  MainElement mainElement = new MainElement();
                      Severity: Major
                      Found in eFormCore/Core.cs - About 3 hrs to fix

                        File SqlControllerTestSite.cs has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        using System;
                        using System.IO;
                        using System.Linq;
                        using System.Reflection;
                        using System.Threading.Tasks;
                        Severity: Minor
                        Found in eFormSDK.Integration.Base.SqlControllerTests/SqlControllerTestSite.cs - About 3 hrs to fix

                          Method GetAllSurveyConfigurations has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public async Task<bool> GetAllSurveyConfigurations()
                                  {
                                      var parsedData = JObject.Parse(await _communicator.GetAllSurveyConfigurations().ConfigureAwait(false));
                          
                                      var jsonSerializerSettings = new JsonSerializerSettings
                          Severity: Major
                          Found in eFormCore/Core.cs - About 3 hrs to fix

                            Method Taggings_Delete_DoesSetWorkflowStateToRemoved has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Method Core_eForm_QuickSyncEnabledeFormFromXML_ReturnseMainElement has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      [Test] // Core_Template_TemplateFromXml_ReturnsTemplate()
                                      public async Task Core_eForm_QuickSyncEnabledeFormFromXML_ReturnseMainElement()
                                      {
                                          // Arrange
                                          string xmlstring = @"

                                Method CheckListSites_Delete_DoesSetWorkflowStateToRemoved has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        [Test]
                                        public async Task CheckListSites_Delete_DoesSetWorkflowStateToRemoved()
                                        {
                                            //Arrange
                                
                                
                                Severity: Major
                                Found in eFormSDK.CheckLists.Tests/CheckListSitesUTest.cs - About 3 hrs to fix

                                  Method TemplateUploadData has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          public async Task<MainElement> TemplateUploadData(MainElement mainElement)
                                          {
                                              if (mainElement == null)
                                                  throw new ArgumentNullException(nameof(mainElement), "mainElement not allowed to be null");
                                  
                                  
                                  Severity: Major
                                  Found in eFormCore/Core.cs - About 3 hrs to fix

                                    Method RunConsole has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            public async Task RunConsole()
                                            {
                                                #region warning
                                    
                                                Console.WriteLine("");
                                    Severity: Major
                                    Found in eFormCore/AdminTools.cs - About 3 hrs to fix

                                      Method Core_Folders_CreateSubFolder_DoesCreateSubFolderWithTranslations has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              [Test]
                                              public async Task Core_Folders_CreateSubFolder_DoesCreateSubFolderWithTranslations()
                                              {
                                                  // Arrange
                                      
                                      Severity: Major
                                      Found in eFormSDK.Integration.Base.CoreTests/CoreTestFolders.cs - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language