IGS/MainWindow.xaml.cs
Method Reader_MultiSourceFrameArrived
has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring. Open
Open
private void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
{
List<ModelVisual3D> models = new List<ModelVisual3D>();
List<ulong> skelIDs = new List<ulong>();
- 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
File MainWindow.xaml.cs
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using IGS;
using Microsoft.Kinect;
using PointAndControl.ComponentHandling;
using PointAndControl.Kinect;
using PointAndControl.MainComponents;
Method Reader_MultiSourceFrameArrived
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
{
List<ModelVisual3D> models = new List<ModelVisual3D>();
List<ulong> skelIDs = new List<ulong>();
Method Kinect_Replace_Button_Click
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void Kinect_Replace_Button_Click(object sender, RoutedEventArgs e)
{
String oldPlace = "";
String newPlace = "";
Method DrawBody
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void DrawBody(IReadOnlyDictionary<JointType, Joint> joints, IDictionary<JointType, Point> jointPoints, DrawingContext drawingContext)
{
// Draw the bones
// Torso
Method RenderClippedEdges
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void RenderClippedEdges(Body body, DrawingContext drawingContext)
{
if (body.ClippedEdges.HasFlag(FrameEdges.Bottom))
{
drawingContext.DrawRectangle(
Method WindowLoaded
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void WindowLoaded(object sender, RoutedEventArgs e)
{
// Create the drawing group we'll use for drawing
_drawingGroup = new DrawingGroup();
Avoid deeply nested control flow statements. Open
Open
if ((int)body.TrackingId == ts.Id)
{
RenderClippedEdges(body, dc);
if (body.IsTracked)
Method DrawBone
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void DrawBone(IReadOnlyDictionary<JointType, Joint> joints, IDictionary<JointType, Point> jointPoints, JointType jointType0, JointType jointType1, DrawingContext drawingContext)