Showing 172 of 172 total issues
Identical blocks of code found in 4 locations. Consider refactoring. Open
for (int i = 15; i < 19; i++)
{
boneListsList[bodyNr].Add(createBones(pList[i], pList[i + 1]));
skelList[bodyNr].Children.Add(boneListsList[bodyNr][i]);
}
- 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 103.
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
Identical blocks of code found in 4 locations. Consider refactoring. Open
for (int i = 0; i < 4; i++)
{
boneListsList[bodyNr].Add(createBones(pList[i], pList[i + 1]));
skelList[bodyNr].Children.Add(boneListsList[bodyNr][i]);
- 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 103.
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
Identical blocks of code found in 4 locations. Consider refactoring. Open
for (int i = 11; i < 15; i++)
{
boneListsList[bodyNr].Add(createBones(pList[i], pList[i + 1]));
skelList[bodyNr].Children.Add(boneListsList[bodyNr][i]);
}
- 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 103.
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
Identical blocks of code found in 4 locations. Consider refactoring. Open
for (int i = 4; i < 8; i++)
{
boneListsList[bodyNr].Add(createBones(pList[i], pList[i + 1]));
skelList[bodyNr].Children.Add(boneListsList[bodyNr][i]);
}
- 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 103.
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 RenderClippedEdges
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void RenderClippedEdges(Body body, DrawingContext drawingContext)
{
if (body.ClippedEdges.HasFlag(FrameEdges.Bottom))
{
drawingContext.DrawRectangle(
Method readWallProjectionSamplesFromXML
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static List<WallProjectionSample> readWallProjectionSamplesFromXML()
{
List<WallProjectionSample> sampleList = new List<WallProjectionSample>();
XmlDocument docConfig = new XmlDocument();
Method jointFilter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Point3D[] jointFilter(List<Point3D[]> jointLists)
{
Point3D[] filtered = new Point3D[4];
double minDist = 0;
Method changeDeviceCoord
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public string changeDeviceCoord(string devId, Ball ball)
{
List<Device> devices = readDevices();
if (devices == null || devices.Count == 0 || devices.Exists(d => d.Id == devId))
Method WriteRedirect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void WriteRedirect(String new_location, int errorNumber)
{
String error = "";
switch (errorNumber)
Method xmlChangeDeviceLocation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String xmlChangeDeviceLocation(Device device, Vector3D position)
{
//add device to configuration XML
XmlDocument docConfig = new XmlDocument();
docConfig.Load(AppDomain.CurrentDomain.BaseDirectory + "\\configuration.xml");
Method Send
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public override String Send(String command)
{
HttpWebRequest request = null;
try
{
Method updateDevice
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public string updateDevice(Device dev)
{
List<Device> devices = readDevices();
if (devices == null || devices.Count == 0)
Method updateDevices
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void updateDevices()
{
if (deviceHolder == null || deviceHolder.devices == null)
return;
Method creatTriangleModelRoom
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private ModelVisual3D creatTriangleModelRoom(Point3D p0, Point3D p1, Point3D p2, bool site)
{
ModelVisual3D group = new ModelVisual3D();
MeshGeometry3D triangleMesh = new MeshGeometry3D();
Vector3D normal = new Vector3D();
Method isFileEnding
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public bool isFileEnding(string pathstring)
{
string ending = getFileEnding(pathstring);
switch (ending)
Function updateDeviceList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var updateDeviceList = function () {
$.getJSON('/?dev=server&cmd=list', function (data) {
var listItems = [];
if (editMode) {
- 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
Function pollDevice
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var pollDevice = function () {
$.getJSON('/?dev=server&cmd=pollDevice', function (data) {
// restart request if we are still on the ar page
var hash = $.mobile.path.parseLocation().hash;
if (hash == '#ar')
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
public WallProjectionAndPositionSample(WallProjectionSample wps, Point3D personPosition, string deviceIdentifier)
{
this.wallPositionX = wps.x;
this.wallPositionY = wps.y;
this.wallPositionZ = wps.z;
- 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 93.
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 WallProjectionAndPositionSample(Point3D wallPosition, Point3D personPosition, string deviceIdentifier)
{
this.wallPositionX = wallPosition.X;
this.wallPositionY = wallPosition.Y;
this.wallPositionZ = wallPosition.Z;
- 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 93.
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 ReadHeaders
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void ReadHeaders()
{
Debug.WriteLine("readHeaders()");
String line;
while ((line = StreamReadLine(InputStream)) != null)