Showing 1,140 of 1,140 total issues
Method diff_linesToCharsMunge
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private string diff_linesToCharsMunge(string text, List<string> lineArray,
Dictionary<string, int> lineHash, int maxLines) {
int lineStart = 0;
int lineEnd = -1;
string line;
Method Backtrack
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Lcs Backtrack(int[,] matrix, List<JToken> left, List<JToken> right, int li, int ri)
{
var result = new Lcs();
for (int i = 1, j = 1; i <= li && j <= ri;)
{
Method Info
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static ImageInfo? Info(Stream stream)
{
var info = new stbi__bmp_data
{
all_a = 255
Method AnchorRefEvaluator
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private string AnchorRefEvaluator(Match match)
{
string wholeMatch = match.Groups[1].Value;
string linkText = SaveFromAutoLinking(match.Groups[2].Value);
string linkID = match.Groups[3].Value.ToLowerInvariant();
Method TryLockAsync
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Task<bool> TryLockAsync(Action callback, TimeSpan timeout)
{
var @lock = new InnerLock(this, _asyncId.Value, ThreadId);
_asyncId.Value = Interlocked.Increment(ref AsyncLock.AsyncStackCounter);
Method TryLockAsync
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Task<bool> TryLockAsync(Action callback, CancellationToken cancel)
{
var @lock = new InnerLock(this, _asyncId.Value, ThreadId);
_asyncId.Value = Interlocked.Increment(ref AsyncLock.AsyncStackCounter);
Method Info
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static ImageInfo? Info(Stream stream)
{
try
{
if (stream.stbi__get32be() != 0x38425053) return null;
Method Erosion1D
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static byte[] Erosion1D(byte[] imageData, int width, int height, int bytePerPixel, int kernelSize, bool horizontal) {
var erodedImage = imageData.DeepCopy();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
var erodePixel = false;
Method GetEulerAnglesAsPitchYawRoll
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static Vector3 GetEulerAnglesAsPitchYawRoll(this Quaternion rotation, bool returnDegree = true) {
var length = rotation.LengthSquared();
if (Math.Abs(length - 1.0f) > 0.0001f) {
throw new ArgumentException($"Invalid rotation quaternion (length not 1 but {length})", nameof(rotation));
}
Method TestViewStack2
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
[UnityTest]
public IEnumerator TestViewStack2() {
string defaultViewStackView = "Canvas/DefaultViewStackView";
Method RunTest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public override IEnumerator RunTest() {
LogConsole.RegisterForAllLogEvents(this);
DataStore<MyDataModel> store = new DataStore<MyDataModel>(Reducers.MainReducer, initialModel);
Method OnLoad
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Task OnLoad(IDataStore<MyDataModel> store) {
var map = targetView.GetLinkMap();
var string1 = map.Get<InputField>("string1");
string1.SubscribeToStateChanges(store, state => state.subSection1.string1, newVal => string1.text = newVal);
Method CalcEntryChanges
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Obsolete("Use CalcEntryChangesToOldState instead", true)]
public static void CalcEntryChanges<T, K>(this IEnumerable<T> oldState, IEnumerable<T> newState, Func<T, K> getKey, Action<T> onEntryAdded, Action<T> onEntryUpdated, Action<K> onEntryRemoved) {
// TODO does not include order changes
if (ReferenceEquals(oldState, newState)) { return; }
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (scrollDirection == Direction.Vertical) {
if (scrollVector.y > 0) {
while (CellsTailEdge - GetCellSize(cells.Last.Value.dataIndex) >= ActiveTailEdge) {
MoveCellLastToFirst();
}
- 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 92.
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 4 locations. Consider refactoring. Open
protected override void PrintInfoMessage(string infoLogMsg, params object[] args) {
LogEntry logEntry = new LogEntry() { i = infoLogMsg };
var asJson = JsonWriter.GetWriter(logEntry).Write(logEntry);
writer.WriteLine(asJson + JSON_LB);
writer.Flush();
- 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 92.
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 4 locations. Consider refactoring. Open
protected override void PrintWarningMessage(string warningMsg, params object[] args) {
LogEntry logEntry = new LogEntry() { w = warningMsg };
var asJson = JsonWriter.GetWriter(logEntry).Write(logEntry);
writer.WriteLine(asJson + JSON_LB);
writer.Flush();
- 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 92.
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 4 locations. Consider refactoring. Open
protected override void PrintErrorMessage(string errorMsg, params object[] args) {
LogEntry logEntry = new LogEntry() { e = errorMsg };
var asJson = JsonWriter.GetWriter(logEntry).Write(logEntry);
writer.WriteLine(asJson + JSON_LB);
writer.Flush();
- 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 92.
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
} else if (scrollDirection == Direction.Horizontal) {
if (scrollVector.x > 0) {
while (CellsHeadEdge + GetCellSize(cells.First.Value.dataIndex) <= ActiveHeadEdge) {
MoveCellFirstToLast();
}
- 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 92.
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 4 locations. Consider refactoring. Open
protected override void PrintDebugMessage(string debugLogMsg, params object[] args) {
LogEntry logEntry = new LogEntry() { d = debugLogMsg };
var asJson = JsonWriter.GetWriter(logEntry).Write(logEntry);
writer.WriteLine(asJson + JSON_LB);
writer.Flush();
- 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 92.
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 static FileEntry GetChild(this DirectoryEntry self, string fileName, bool sanitize = true) {
fileName.ThrowErrorIfNullOrEmpty("fileName");
if (sanitize) { fileName = Sanitize.SanitizeToFileName(fileName); }
AssertV3.AreEqual(fileName, Sanitize.SanitizeToFileName(fileName));
return ResolveFilePath(self, fileName);
- 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 92.
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