Showing 1,140 of 1,140 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
private static MyModel MyReducer(MyModel previousState, object action) {
bool modelChanged = false;
var users = previousState.MutateField(previousState.users, action, ReduceUsers, ref modelChanged);
var selectedUser = previousState.MutateField(previousState.currentlySelectedUser, action, ReduceSelection, ref modelChanged);
if (modelChanged) { return new MyModel(selectedUser, users); }
- 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 108.
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
public void SetElementColor(int elementIndex, ref Color startColor, ref Color endColor)
{
var offset = elementIndex * 4;
m_Colors[offset] = startColor;
m_Colors[offset + 1] = m_Colors[offset];
- 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 107.
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 3 locations. Consider refactoring. Open
private static double[] AddArrays(double[] array1, double[] array2) {
if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }
return array1.Zip(array2, (x, y) => x + y).ToArray();
}
- 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 107.
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
public void SetElementColor32(int elementIndex, ref Color32 startColor, ref Color32 endColor)
{
var offset = elementIndex * 4;
m_Colors[offset] = startColor;
m_Colors[offset + 1] = m_Colors[offset];
- 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 107.
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
private void InitDebouncedDownloadLogic() {
latestRawSheetData = null;
// Create a debounced func that only downloads new data max every 10 seconds and
// trigger this method only if inet available:
Func<Task> t = async () => {
- 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 107.
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 3 locations. Consider refactoring. Open
private static double[] MultArrays(double[] array1, double[] array2) {
if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }
return array1.Zip(array2, (x, y) => x * y).ToArray();
- 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 107.
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 3 locations. Consider refactoring. Open
private static double[] SubArrays(double[] array1, double[] array2) {
if (array1 == null || array2 == null) { throw new ArgumentException("Input arrays cannot be null."); }
if (array1.Length != array2.Length) { throw new ArgumentException("Input arrays must have the same length."); }
return array1.Zip(array2, (x, y) => x - y).ToArray();
}
- 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 107.
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
private void InitDebouncedDownloadLogic() {
sheetData = null;
// Create a debounced func that only downloads new data max every 10 seconds and
// trigger this method only if inet available:
Func<Task> t = async () => {
- 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 107.
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 ReloadData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void ReloadData(bool isReset = false) {
if (rectTransform == null) {
rectTransform = GetComponent<RectTransform>();
}
if (scrollRect == null) {
Method MaterialChanged
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void MaterialChanged(Material material)
{
var worldDataMode = false;
var depthScaleMode = true;
if (material.HasProperty("_WorldData"))
Method Drop
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void Drop(CollectionPage col)
{
// add all pages to delete
var pages = new HashSet<uint>();
Method Delete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int Delete(string collection, Query query)
{
if (collection.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(collection));
if (query == null) throw new ArgumentNullException(nameof(query));
Method Update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public DataBlock Update(CollectionPage col, PageAddress blockAddress, byte[] data)
{
// get datapage and mark as dirty
var dataPage = _pager.GetPage<DataPage>(blockAddress.PageID);
var block = dataPage.GetBlock(blockAddress.Index);
Method ReadNumber
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private string ReadNumber(ref bool dbl)
{
var sb = new StringBuilder();
sb.Append(_char);
Method Dispose
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void Dispose()
{
#if DEBUG
Debug.Assert(!_disposed);
_disposed = true;
Method stbi__decode_jpeg_header
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private bool stbi__decode_jpeg_header(int scan)
{
var m = 0;
jfif = 0;
app14_color_transform = -1;
Method SendAsync
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async Task<HttpResponseMessage> SendAsync(HttpMethod method) {
if (handler == null) {
handler = new HttpClientHandler() {
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
Method ValidateAndEscapeDelimiters
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void ValidateAndEscapeDelimiters()
{
if (m_Delimiters == null)
throw new ArgumentException("", nameof(Delimiters)); //GetArgumentExceptionWithArgName["Delimiters", ResID.MyID.TextFieldParser_DelimitersNothing, "Delimiters"];
Method RunTest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public override IEnumerator RunTest() {
var map = gameObject.GetLinkMap();
// A minimalistic simple example to show an action menu:
Method TestDataStoreTransitiveChanges
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Fact]
public static void TestDataStoreTransitiveChanges() {
CellsModel model = new CellsModel(ImmutableDictionary<CellPos, Cell>.Empty);
var store = new DataStore<CellsModel>(CellsReducers.MainReducer, model, Middlewares.NewLoggingMiddleware<CellsModel>());