Showing 3,203 of 3,219 total issues
Method WorkerGetAll
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<List<WorkerDto>> WorkerGetAll(string workflowState, int? offSet, int? limit)
{
string methodName = "SqlController.WorkerGetAll";
try
{
Method Workers_Update_DoesUpdate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Workers_Update_DoesUpdate()
{
//Arrange
Method FieldValidation
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async Task<List<string>> FieldValidation(MainElement mainElement)
{
string methodName = "Core.FieldValidation";
Log.LogStandard(methodName, "called");
Method Core_Case_CaseToJasperXml_ReturnsPath
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Core_Case_CaseToJasperXml_ReturnsPath()
{
// Arrange
Similar blocks of code found in 2 locations. Consider refactoring. Open
case Constants.Constants.FieldTypes.ShowPdf:
lstDataItem.Add(new ShowPdf(_t.Int(field.Id), _t.Bool(field.Mandatory), _t.Bool(field.ReadOnly),
fieldTranslation.Text, fieldTranslation.Description, field.Color,
_t.Int(field.DisplayIndex), _t.Bool(field.Dummy),
fieldTranslation.DefaultValue));
- Read upRead up
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 136.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
[Test]
public async Task Core_EntitySelectItemCreate_CreatesEntitySelectItem()
{
// Arrance
EntityGroup eG1 = await testHelpers.CreateEntityGroup("microtingUIdC1", "EntityGroup1",
- Read upRead up
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 136.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
[Test]
public async Task Core_EntitySearchItemCreate_CreatesEntitySearchItem()
{
// Arrance
EntityGroup eG1 = await testHelpers.CreateEntityGroup("microtingUIdC1", "EntityGroup1",
- Read upRead up
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 136.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case Constants.Constants.FieldTypes.SaveButton:
lstDataItem.Add(new SaveButton(_t.Int(field.Id), _t.Bool(field.Mandatory),
_t.Bool(field.ReadOnly), fieldTranslation.Text, fieldTranslation.Description, field.Color,
_t.Int(field.DisplayIndex), _t.Bool(field.Dummy),
fieldTranslation.DefaultValue));
- Read upRead up
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 136.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method EntityGroups_Update_DoesUpdate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task EntityGroups_Update_DoesUpdate()
{
EntityGroup entityGroup = new EntityGroup
{
Method EntityItemUpdate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task EntityItemUpdate(int id, string name, string description, string ownUuid, int displayIndex)
{
await using var dbContext = DbContextHelper.GetDbContext();
Microting.eForm.Infrastructure.Data.Entities.EntityItem et =
await dbContext.EntityItems.FirstOrDefaultAsync(x => x.Id == id);
Method SurveyConfigurations_Create_DoesCreate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SurveyConfigurations_Create_DoesCreate()
{
//Arrange
Random rnd = new Random();
Method SiteTags_MultipleCreateAndDelete
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SiteTags_MultipleCreateAndDelete()
{
Random rnd = new Random();
Method SiteWorkers_Create_DoesCreate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SiteWorkers_Create_DoesCreate()
{
// Arrange
Method QuestionSets_Delete_DoesSetWorkflowStateToRemoved
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task QuestionSets_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Method TemplateFromXml
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
public async Task<MainElement> TemplateFromXml(string xmlString)
#pragma warning restore 1998
{
if (string.IsNullOrEmpty(xmlString))
throw new ArgumentNullException("xmlString cannot be null or empty");
- Read upRead up
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 SettingCreateDefaults
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<bool> SettingCreateDefaults()
{
string methodName = "SqlController.SettingCreateDefaults";
WriteDebugConsoleLogEntry(new LogEntry(2, methodName, "called"));
Method Up
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FolderTranslations",
columns: table => new
Method CaseReadFirstId
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<int?> CaseReadFirstId(int? templateId, string workflowState)
{
string methodName = "SqlController.CaseReadFirstId";
_log.LogStandard(methodName, "called");
_log.LogVariable(methodName, nameof(templateId), templateId);
Method Handle
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task Handle(TranscriptionCompleted message)
{
try
{
FieldValue fv = await sqlController.GetFieldValueByTranscriptionId(message.MicrotringUUID);
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
{