teco-kit/PointAndControl

View on GitHub

Showing 172 of 172 total issues

Method InterpretCommand has a Cognitive Complexity of 112 (exceeds 20 allowed). Consider refactoring.
Open

        public String InterpretCommand(object sender, HttpEventArgs args)
        {
            String devId = args.Dev;
            String cmd = args.Cmd;
            String value = args.Val;
Severity: Minor
Found in IGS/MainComponents/PointAndControlMain.cs - About 1 day to fix

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 static void writeWallProjectionSampleToXML(WallProjectionSample sample)
        {
            XmlDocument docConfig = new XmlDocument();

            docConfig.Load(AppDomain.CurrentDomain.BaseDirectory + "\\WallProjectionSamples.xml");
Severity: Major
Found in IGS/Helperclasses/XMLComponentHandler.cs and 1 other location - About 1 day to fix
IGS/Helperclasses/XMLComponentHandler.cs on lines 254..309

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 663.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        public static void writeWallProjectionSampleToConfig(WallProjectionSample sample)
        {
            XmlDocument docConfig = new XmlDocument();
            docConfig.Load(AppDomain.CurrentDomain.BaseDirectory + "\\configuration.xml");
            XmlNode node = docConfig.SelectSingleNode("/config");
Severity: Major
Found in IGS/Helperclasses/XMLComponentHandler.cs and 1 other location - About 1 day to fix
IGS/Helperclasses/XMLComponentHandler.cs on lines 195..251

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 663.

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

Further Reading

Method InterpretCommand has 234 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public String InterpretCommand(object sender, HttpEventArgs args)
        {
            String devId = args.Dev;
            String cmd = args.Cmd;
            String value = args.Val;
Severity: Major
Found in IGS/MainComponents/PointAndControlMain.cs - About 1 day to fix

    File XMLComponentHandler.cs has 519 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using PointAndControl.Classifier;
    using System;
    using System.Collections.Generic;
    using System.Windows.Media.Media3D;
    using System.Xml;
    Severity: Major
    Found in IGS/Helperclasses/XMLComponentHandler.cs - About 1 day to fix

      File Room3DView.xaml.cs has 510 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Windows;
      using System.Windows.Media;
      Severity: Major
      Found in IGS/Room3DView.xaml.cs - About 1 day to fix

        File PointAndControlMain.cs has 501 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Collections.Generic;
        using System.Linq;
        using System.Windows.Media.Media3D;
        using System.Diagnostics;
        Severity: Major
        Found in IGS/MainComponents/PointAndControlMain.cs - About 1 day to fix

          Method Reader_MultiSourceFrameArrived has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring.
          Open

              private void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
              {
          
                  List<ModelVisual3D> models = new List<ModelVisual3D>();
                  List<ulong> skelIDs = new List<ulong>();
          Severity: Minor
          Found in IGS/MainWindow.xaml.cs - About 7 hrs to fix

          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 SimpleHttpServer.cs has 486 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using System;
          using System.Collections;
          using System.Collections.Specialized;
          using System.IO;
          using System.Net;
          Severity: Minor
          Found in IGS/WebServer/SimpleHttpServer.cs - About 7 hrs to fix

            Method reader_FramesReady has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
            Open

                    public void reader_FramesReady(object sender, BodyFrameArrivedEventArgs e)
                    {
            
                        if (e == null)
                            return;
            Severity: Minor
            Found in IGS/Kinect/UserTracker.cs - About 6 hrs to fix

            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 adapter.js has 434 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             *  Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
             *
             *  Use of this source code is governed by a BSD-style license
             *  that can be found in the LICENSE file in the root of the source
            Severity: Minor
            Found in IGS/Resources/HttpRoot/js/adapter.js - About 6 hrs to fix

              File site.js has 407 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // check if vibration is supported
              var supportsVibrate = "vibrate" in navigator;
              var trackingId = null;
              var beforeRegister;
              var editDevice = "";
              Severity: Minor
              Found in IGS/Resources/HttpRoot/js/site.js - About 5 hrs to fix

                File MainWindow.xaml.cs has 385 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using IGS;
                using Microsoft.Kinect;
                using PointAndControl.ComponentHandling;
                using PointAndControl.Kinect;
                using PointAndControl.MainComponents;
                Severity: Minor
                Found in IGS/MainWindow.xaml.cs - About 5 hrs to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          {
                              this.transformator = transformator;
                              skelList = new List<ModelVisual3D>();
                              boneListInitList = new List<Boolean>();
                              IDList = new List<long>();
                  Severity: Major
                  Found in IGS/Room3DView.xaml.cs and 1 other location - About 4 hrs to fix
                  IGS/Room3DView.xaml.cs on lines 121..151

                  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 297.

                  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

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          {
                              this.transformator = transformator;
                              skelList = new List<ModelVisual3D>();
                              boneListInitList = new List<Boolean>();
                              IDList = new List<long>();
                  Severity: Major
                  Found in IGS/Room3DView.xaml.cs and 1 other location - About 4 hrs to fix
                  IGS/Room3DView.xaml.cs on lines 88..118

                  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 297.

                  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

                  Further Reading

                  Function RTCPeerConnection has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                    window.RTCPeerConnection = function(pcConfig, pcConstraints) {
                      if (webrtcDetectedVersion < 38) {
                        // .urls is not supported in FF < 38.
                        // create RTCIceServers with a single url.
                        if (pcConfig && pcConfig.iceServers) {
                  Severity: Minor
                  Found in IGS/Resources/HttpRoot/js/adapter.js - About 4 hrs to fix

                  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

                      $("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all toast'>"+msg+"</div>")
                      .css({ padding: "5px",
                          width: "290px",
                          left: ($(window).width() - 300)/2,
                          top: "0.7em" })
                  Severity: Major
                  Found in IGS/Resources/HttpRoot/js/remote.js and 1 other location - About 3 hrs to fix
                  IGS/Resources/HttpRoot/js/site.js on lines 20..30

                  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 114.

                  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

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      $("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all toast'>" + msg + "</div>")
                      .css({
                          padding: "5px",
                          width: "290px",
                          left: ($(window).width() - 300) / 2,
                  Severity: Major
                  Found in IGS/Resources/HttpRoot/js/site.js and 1 other location - About 3 hrs to fix
                  IGS/Resources/HttpRoot/js/remote.js on lines 2..10

                  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 114.

                  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

                  Further Reading

                  Method createBody has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public void createBody(Body body)
                          {
                              //Decide if one skeleton have to be replaced, created, or is already existing
                              int IDPlace = -1;
                              bool IDfound = false;
                  Severity: Major
                  Found in IGS/Room3DView.xaml.cs - About 3 hrs to fix

                    Method Filter has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
                    Open

                            public override List<TrackedSkeleton> Filter(Body[] bodies, List<TrackedSkeleton> trackedSkeletons, int id, BodyFrameReader reader)
                            {
                                if (trackedSkeletons == null)
                                    return trackedSkeletons;
                    
                    Severity: Minor
                    Found in IGS/Kinect/HandsUp.cs - About 3 hrs to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language