teco-kit/PointAndControl

View on GitHub

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]);
            }
Severity: Major
Found in IGS/Room3DView.xaml.cs and 3 other locations - About 1 hr to fix
IGS/Room3DView.xaml.cs on lines 639..644
IGS/Room3DView.xaml.cs on lines 645..649
IGS/Room3DView.xaml.cs on lines 659..663

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

Further Reading

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]);
Severity: Major
Found in IGS/Room3DView.xaml.cs and 3 other locations - About 1 hr to fix
IGS/Room3DView.xaml.cs on lines 645..649
IGS/Room3DView.xaml.cs on lines 659..663
IGS/Room3DView.xaml.cs on lines 665..669

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

Further Reading

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]);
            }
Severity: Major
Found in IGS/Room3DView.xaml.cs and 3 other locations - About 1 hr to fix
IGS/Room3DView.xaml.cs on lines 639..644
IGS/Room3DView.xaml.cs on lines 645..649
IGS/Room3DView.xaml.cs on lines 665..669

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

Further Reading

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]);
            }
Severity: Major
Found in IGS/Room3DView.xaml.cs and 3 other locations - About 1 hr to fix
IGS/Room3DView.xaml.cs on lines 639..644
IGS/Room3DView.xaml.cs on lines 659..663
IGS/Room3DView.xaml.cs on lines 665..669

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

Further Reading

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(
Severity: Minor
Found in IGS/MainWindow.xaml.cs - About 1 hr to fix

    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();
    Severity: Minor
    Found in IGS/Helperclasses/XMLComponentHandler.cs - About 1 hr to fix

      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;
      Severity: Minor
      Found in IGS/Kinect/MedianJointFilter.cs - About 1 hr to fix

        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))
        Severity: Minor
        Found in IGS/ComponentHandling/DeviceStorageFileHandlerJSON.cs - About 1 hr to fix

          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)
          Severity: Minor
          Found in IGS/WebServer/SimpleHttpServer.cs - About 1 hr to fix

            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");
            Severity: Minor
            Found in IGS/MainComponents/CollisionMethod.cs - About 1 hr to fix

              Method Send has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public override String Send(String command)
                      {
                          HttpWebRequest request = null;
                          try
                          {
              Severity: Minor
              Found in IGS/Devices/HTTP.cs - About 1 hr to fix

                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)
                Severity: Minor
                Found in IGS/ComponentHandling/DeviceStorageFileHandlerJSON.cs - About 1 hr to fix

                  Method updateDevices has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public void updateDevices()
                          {
                              if (deviceHolder == null || deviceHolder.devices == null)
                                  return;
                  
                  
                  Severity: Minor
                  Found in IGS/ThirdPartyRepos/RepositoryRepresentation.cs - About 1 hr to fix

                    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();
                    Severity: Minor
                    Found in IGS/Room3DView.xaml.cs - About 1 hr to fix

                      Method isFileEnding has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public bool isFileEnding(string pathstring)
                              {
                                  string ending = getFileEnding(pathstring);
                      
                                  switch (ending)
                      Severity: Minor
                      Found in IGS/WebServer/SimpleHttpServer.cs - About 1 hr to fix

                        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) {
                        Severity: Minor
                        Found in IGS/Resources/HttpRoot/js/site.js - About 1 hr 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

                        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')
                        Severity: Minor
                        Found in IGS/Resources/HttpRoot/js/site.js - About 1 hr 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 WallProjectionAndPositionSample(WallProjectionSample wps, Point3D personPosition, string deviceIdentifier)
                                {
                                    this.wallPositionX = wps.x;
                                    this.wallPositionY = wps.y;
                                    this.wallPositionZ = wps.z;
                        Severity: Major
                        Found in IGS/Classifier/WallProjectionAndPositionSample.cs and 1 other location - About 1 hr to fix
                        IGS/Classifier/WallProjectionAndPositionSample.cs on lines 44..53

                        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

                        Further Reading

                        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;
                        Severity: Major
                        Found in IGS/Classifier/WallProjectionAndPositionSample.cs and 1 other location - About 1 hr to fix
                        IGS/Classifier/WallProjectionAndPositionSample.cs on lines 55..64

                        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

                        Further Reading

                        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)
                        Severity: Minor
                        Found in IGS/WebServer/SimpleHttpServer.cs - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language