microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method Core_Folders_CreateFolder_DoesCreateNewFolderWithTranslations has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Method SQL_answers_Delete_DoesDelete_UTCAdjustedTrue has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method SQL_answers_Delete_DoesDelete_UTCAdjustedFalse has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method ReadSorted has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public static async Task<Models.EntityGroup> ReadSorted(MicrotingDbContext dbContext, string entityGroupMUId,
                    string sort,
                    string nameFilter)
                {
                    EntityGroup eG =
        Severity: Major
        Found in eFormCore/Infrastructure/Data/Entities/EntityGroup.cs - About 2 hrs to fix

          Method CheckRead has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public async Task<ReplyElement> CheckRead(int microtingUId, int checkUId, Language language)
                  {
                      string methodName = "SqlController.CheckRead";
                      try
                      {
          Severity: Major
          Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

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

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

              Method Core_Tags_TemplateSetTags_DoesAssignTagToTemplateWithoutDuplicates has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public async Task Core_Tags_TemplateSetTags_DoesAssignTagToTemplateWithoutDuplicates()
                      {
                          // Arrance
                          CheckList cl1 = new CheckList
              Severity: Minor
              Found in eFormSDK.Integration.Base.CoreTests/CoreTestTag.cs - About 2 hrs to fix

                Method TemplateSetTags has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public async Task<bool> TemplateSetTags(int templateId, List<int> tagIds)
                        {
                            string methodName = "SqlController.TemplateSetTags";
                            try
                            {
                Severity: Minor
                Found in eFormCore/Infrastructure/SqlController.cs - About 2 hrs to fix

                  Method CreateCase has 16 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          public async Task<Case> CreateCase(string caseUId, CheckList checkList, DateTime created_at, string custom,
                              DateTime done_at, Worker doneByUserId, int microtingCheckId, int microtingUId, Site site, int? status,
                              string caseType, Unit unit, DateTime updated_at, int version, Worker worker, string WorkFlowState)
                  Severity: Major
                  Found in eFormCore/Helpers/TestHelpers.cs - About 2 hrs to fix

                    Method Restart has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public override async Task Restart(int sameExceptionCount, int sameExceptionCountMax)
                            {
                                string methodName = "Core.Restart";
                                try
                                {
                    Severity: Minor
                    Found in eFormCore/Core.cs - About 2 hrs to fix

                      Method SiteSurveyConfigurations_Create_DoesCreate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method SQL_answers_Create_DoesCreate_UTCAdjustedFalse has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public async Task SQL_answers_Create_DoesCreate_UTCAdjustedFalse()
                                {
                                    // Arrange
                                    Random rnd = new Random();
                        Severity: Minor
                        Found in eFormSDK.Integration.Tests/SqlControllerTestAnswer.cs - About 1 hr to fix

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

                                  protected override void Up(MigrationBuilder migrationBuilder)
                                  {
                          
                                      //Setup for SQL Server Provider
                                     
                          Severity: Minor
                          Found in eFormCore/Migrations/20190828074017_AddingMissingClasses.cs - About 1 hr to fix

                            Method CreateField has 49 lines of code (exceeds 25 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: Minor
                            Found in eFormCore/Helpers/TestHelpers.cs - About 1 hr to fix

                              Method ReplaceDataElementsAndDataItems has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      private async Task<List<Element>> ReplaceDataElementsAndDataItems(int caseId, List<Element> elementList,
                                          List<FieldValue> lstAnswers)
                                      {
                                          List<Element> elementListReplaced = new List<Element>();
                              
                              
                              Severity: Minor
                              Found in eFormCore/Core.cs - About 1 hr to fix

                                Method Folders_Delete_DoesSetWorkflowStateToRemoved has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        [Test]
                                        public async Task Folders_Delete_DoesSetWorkflowStateToRemoved()
                                        {
                                            //Arrange
                                
                                
                                Severity: Minor
                                Found in eFormSDK.Base.Tests/FoldersUTest.cs - About 1 hr to fix

                                  Method LanguageQuestionSet_Delete_DoesDelete has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          [Test]
                                          public async Task LanguageQuestionSet_Delete_DoesDelete()
                                          {
                                              //Assert
                                              Random rnd = new Random();
                                  Severity: Minor
                                  Found in eFormSDK.InSight.Tests/LanguageQuestionSetUTest.cs - About 1 hr to fix

                                    Method JsonToClass has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            public Response JsonToClass(string json)
                                            {
                                                try
                                                {
                                                    string value = "";
                                    Severity: Minor
                                    Found in eFormCore/Infrastructure/Models/reply/Response.cs - About 1 hr to fix

                                      Method SiteTags_Update_DoesUpdate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              [Test]
                                              public async Task SiteTags_Update_DoesUpdate()
                                              {
                                                  // Arrange
                                                  Random rnd = new Random();
                                      Severity: Minor
                                      Found in eFormSDK.Base.Tests/SiteTagsUTest.cs - About 1 hr to fix

                                        Method GetElement has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
                                        Open

                                                private async Task<Element> GetElement(int elementId, Language language, bool includeDummyFields)
                                                {
                                                    string methodName = "SqlController.GetElement";
                                                    try
                                                    {
                                        Severity: Minor
                                        Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language