Showing 3,203 of 3,219 total issues
Method CaseCreate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<List<int>> CaseCreate(MainElement mainElement, string caseUId, List<int> siteUids,
string custom, int? folderId)
{
string methodName = "Core.CaseCreate";
try
Method SurveyConfigurations_Delete_DoesSetWorkflowStateToRemoved
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SurveyConfigurations_Delete_DoesSetWorkflowStateToRemoved()
{
//Arrange
Random rnd = new Random();
Method Folders_Update_DoesUpdate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Folders_Update_DoesUpdate()
{
//Arrange
File CoreTestSite.cs
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
Method question_Delete_DoesDelete_AllFalse
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_AllFalse()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetTrue_BackButtonEnabledTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetTrue_BackButtonEnabledTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetFalse_PrioritisedTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetFalse_PrioritisedTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetTrue_PrioritisedTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetTrue_PrioritisedTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetTrue_ImageTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetTrue_ImageTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetFalse_ValidDisplayTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetFalse_ValidDisplayTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetFalse_ImageTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetFalse_ImageTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetTrue_ValidDisplayTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetTrue_ValidDisplayTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_AllTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_AllTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method question_Delete_DoesDelete_QuestionSetFalse_BackButtonEnabledTrue
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task question_Delete_DoesDelete_QuestionSetFalse_BackButtonEnabledTrue()
{
// Arrange
string name = Guid.NewGuid().ToString();
Method Units_Create_DoesCreate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task Units_Create_DoesCreate()
{
//Arrange
Method SiteWorkers_Update_DoesUpdate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public async Task SiteWorkers_Update_DoesUpdate()
{
// Arrange
Similar blocks of code found in 2 locations. Consider refactoring. Open
case Constants.Constants.FieldTypes.Picture:
lstDataItem.Add(new Picture(_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),
_t.Int(field.Multi), _t.Bool(field.GeolocationEnabled)));
- 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 162.
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.CheckBox:
lstDataItem.Add(new CheckBox(_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),
_t.Bool(fieldTranslation.DefaultValue), _t.Bool(field.Selected)));
- 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 162.
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
Class CoreTestAdvanced
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
[Parallelizable(ParallelScope.Fixtures)]
[TestFixture]
public class CoreTestAdvanced : DbTestFixture
{
private Core sut;
Class SqlControllerTestCase
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
[Parallelizable(ParallelScope.Fixtures)]
[TestFixture]
public class SqlControllerTestCase : DbTestFixture
{
private SqlController sut;