microting/eform-sdk-dotnet

View on GitHub

Showing 886 of 3,221 total issues

Method FolderCreate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public async Task<int> FolderCreate(List<CommonTranslationsModel> translations, int? parentId)
        {
            string methodName = "Core.FolderCreate";
            try
            {
Severity: Minor
Found in eFormCore/Core.cs - About 1 hr to fix

    Method Down has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected override void Down(MigrationBuilder migrationBuilder)
            {
                migrationBuilder.DropTable(
                    name: "CheckListTranslations");
    
    
    Severity: Minor
    Found in eFormCore/Migrations/20201225165255_FixingBrokenTableNames.cs - About 1 hr to fix

      Method Down has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              protected override void Down(MigrationBuilder migrationBuilder)
              {
                  migrationBuilder.DropForeignKey(
                      name: "FK_answer_values_options_OptionId",
                      table: "answer_values");

        Method Down has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                protected override void Down(MigrationBuilder migrationBuilder)
                {
                    migrationBuilder.DropTable(
                        name: "SiteTags");
        
        
        Severity: Minor
        Found in eFormCore/Migrations/20200116074236_AddingSiteTaggins.cs - About 1 hr to fix

          Method GenerateSmileyOptions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private async Task GenerateSmileyOptions(MicrotingDbContext dbContext, int languageId)
                  {
                      string[] smileys = { "" };
                      switch (QuestionType)
                      {
          Severity: Minor
          Found in eFormCore/Infrastructure/Data/Entities/Question.cs - About 1 hr to fix

            Method CaseToPdf has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public async Task<string> CaseToPdf(int caseId, string jasperTemplate, string timeStamp,
                        string customPathForUploadedData, string fileType, string customXmlContent, Language language)
                    {
                        if (fileType != "pdf" && fileType != "docx" && fileType != "pptx")
                        {
            Severity: Minor
            Found in eFormCore/Core.cs - About 1 hr to fix

              Method Languages_Update_DoesUpdate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Method FolderCreate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public async Task<int> FolderCreate(List<KeyValuePair<string, string>> name,
                            List<KeyValuePair<string, string>> description, int? parentId)
                        {
                            string methodName = "Core.FolderCreate";
                            try
                Severity: Minor
                Found in eFormCore/Core.cs - About 1 hr to fix

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

                          protected override void Up(MigrationBuilder migrationBuilder)
                          {
                              migrationBuilder.DropForeignKey(
                                  name: "FK_answer_values_options_OptionsId",
                                  table: "answer_values");

                    Method Workers_Delete_DoesSetWorkflowstateToRemoved has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method CasesToCsv has 13 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              public async Task<string> CasesToCsv(int templateId, DateTime? start, DateTime? end, string pathAndName,
                                  string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
                                  CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool gpsCoordinates,
                                  bool includeCheckListText)
                      Severity: Major
                      Found in eFormCore/Core.cs - About 1 hr to fix

                        Method SQL_Template_TemplateDisplayIndexChange_ChangesDisplayIndex has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

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

                                  protected override void Up(MigrationBuilder migrationBuilder)
                                  {
                                      migrationBuilder.AddColumn<int>(
                                          name: "FolderId",
                                          table: "check_list_sites",

                            Method TemplateFieldReadAll has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public async Task<List<FieldDto>> TemplateFieldReadAll(int templateId, Language language)
                                    {
                                        string methodName = "SqlController.TemplateFieldReadAll";
                                        _log.LogEverything(methodName, "Start");
                                        try
                            Severity: Minor
                            Found in eFormCore/Infrastructure/SqlController.cs - About 1 hr to fix

                              Method MapVersion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      private object MapVersion(object obj)
                                      {
                                          Type type = obj.GetType().UnderlyingSystemType;
                                          String className = type.Name;
                                          var name = obj.GetType().FullName + "Version";
                              Severity: Minor
                              Found in eFormCore/Infrastructure/Data/Entities/PnBase.cs - About 1 hr to fix

                                Method DbSettingsReloadRemote has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        public async Task<string> DbSettingsReloadRemote()
                                        {
                                            try
                                            {
                                                DbContextHelper dbContextHelper = new DbContextHelper(connectionString);
                                Severity: Minor
                                Found in eFormCore/AdminTools.cs - About 1 hr to fix

                                  Method Folders_Create_DoesCreate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    Function check_new_nuget_version has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def check_new_nuget_version(package_name):
                                        # Construct the NuGet package URL
                                        package_url = f"https://api.nuget.org/v3-flatcontainer/{package_name.lower()}/index.json"
                                        #print(package_url)
                                        
                                    Severity: Minor
                                    Found in cronjob.py - 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

                                    Method CasesToCsv has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public async Task<string> CasesToCsv(int templateId, DateTime? start, DateTime? end, string pathAndName,
                                                string customPathForUploadedData, string decimalSeparator, string thousandSeparator, bool utcTime,
                                                CultureInfo cultureInfo, TimeZoneInfo timeZoneInfo, Language language, bool gpsCoordinates,
                                                bool includeCheckListText)
                                            {
                                    Severity: Minor
                                    Found in eFormCore/Core.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

                                    Method SQL_File_FileCaseFindMUId_doesFindMUId has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            [Test]
                                            public async Task SQL_File_FileCaseFindMUId_doesFindMUId()
                                            {
                                                Random rnd = new Random();
                                                Site site1 = await testHelpers.CreateSite("MySite", 22);
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language