patrickfav/indoor-positioning

View on GitHub

Showing 365 of 365 total issues

Method bruteforce has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    private static BruteforceDistanceResult bruteforce(EEnvironmentModel envModel, EFrequencyRange range, List<BruteforceDistanceInfo> list,
                                                       LoopData boundData, LoopData facData, LoopData multiData, LoopData offsetMData,
                                                       double bestOffsetParam, int oldIterator) {
        ITUIndoorModelDegradingDist.ITUDegradingDistConfig bestConfig = null;
        double bestMult = 1;

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

Method checkForIgnoredMac has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    private void checkForIgnoredMac(Map<EFrequencyRange, List<ExtendedNodeInfo>> extendedNodeMap, String networkId) {
        try {
            Blacklist blacklist = MiscManager.getInstance().getBlacklistByNetworkId(networkId);

            for (EFrequencyRange eFrequencyRange : extendedNodeMap.keySet()) {

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

Method parseIwinfoAdapterList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static IwinfoList parseIwinfoAdapterList(String xml) throws Exception {
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document document = builder.parse(new InputSource(new StringReader(xml)));

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

        if(mac1 != mac2) {
            var elem = angular.element($window.document.getElementById(mac2 + "_" + mac1));
            if(elem) {
                elem.removeClass("cross-highlight");
                angular.element($window.document.getElementById(mac1+ "_" + mac2)).removeClass("cross-highlight");
Severity: Major
Found in src/main/webapp/js/network-details-analysis.js and 1 other location - About 3 hrs to fix
src/main/webapp/js/network-details-analysis.js on lines 227..233

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

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

        if(mac1 != mac2) {
            var elem = angular.element($window.document.getElementById(mac2 + "_" + mac1));
            if(elem) {
                elem.addClass("cross-highlight");
                angular.element($window.document.getElementById(mac1 + "_" + mac2)).addClass("cross-highlight");
Severity: Major
Found in src/main/webapp/js/network-details-analysis.js and 1 other location - About 3 hrs to fix
src/main/webapp/js/network-details-analysis.js on lines 237..243

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

File positioning.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function () {
    'use strict';

    angular.module('adminConsoleApp').controller('PositioningCtrl', ['$scope', '$http', 'navStatus', 'localStorageService', 'signalmapApi', 'signalmapCallbacks','$timeout', function ($scope, $http, navStatus, localStorageService, signalmapApi, signalmapCallbacks,$timeout) {

Severity: Minor
Found in src/main/webapp/js/positioning.js - About 3 hrs to fix

    Method equals has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
    
    

    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

    Method getSingleCharStringRepresentation has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public String getSingleCharStringRepresentation(String sourceMacAddr) {
            if (isFixedPosNode() && getFixedPosMacAddress().equalsIgnoreCase(sourceMacAddr)) {
                return SENSOR_REPRESENTATION;
            } else {
                if (!probMap.containsKey(sourceMacAddr)) {

    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

    Method equals has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
    
    

    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

                for(var i=0;i<$scope.roomList.rooms.length;i++) {
                    if($scope.roomList.rooms[i].roomId == $scope.node.roomId) {
                        copyRoom($scope.roomList.rooms[i],$scope.roomObj);
                        break;
                    }
    Severity: Major
    Found in src/main/webapp/js/node-add.js and 1 other location - About 3 hrs to fix
    src/main/webapp/js/node-add.js on lines 52..57

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

    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

                        for(var i=0;i<$scope.roomList.rooms.length;i++) {
                            if($scope.roomList.rooms[i].name == $scope.roomObj.name) {
                                copyRoom($scope.roomList.rooms[i],$scope.roomObj);
                                break;
                            }
    Severity: Major
    Found in src/main/webapp/js/node-add.js and 1 other location - About 3 hrs to fix
    src/main/webapp/js/node-add.js on lines 23..28

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

    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 createSignalMap has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public SignalMap createSignalMap() {
            int maxX = 0;
            int maxY = 0;
            int minX = Integer.MAX_VALUE;
            int minY = Integer.MAX_VALUE;

    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

    Method calculatePosition has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public ExtendedNodePositionWrapper calculatePosition() {
            ExtendedNodePositionWrapper wrapper = new ExtendedNodePositionWrapper();
    
            data = new NodeDistanceMatrix(analysis, range);
    
    

    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 createFrequencyGraph has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function createFrequencyGraph(adapter, ssid, mac) {
            if ($scope.surveys[adapter] != undefined) {
                $scope.surveys[adapter].frequencyChartConfig = {
                    title: {text: ''},
                    options: {
    Severity: Major
    Found in src/main/webapp/js/node-detail.js - About 2 hrs to fix

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

                          for (var i = 0; i < $scope.probablePositionsWrapper.probablePositions.bestPositions.length; i++) {
                              signalmapApi.highlightTile($scope.probablePositionsWrapper.probablePositions.bestPositions[i].x, $scope.probablePositionsWrapper.probablePositions.bestPositions[i].y, 'best');
                          }
      Severity: Major
      Found in src/main/webapp/js/positioning.js and 1 other location - About 2 hrs to fix
      src/main/webapp/js/positioning.js on lines 309..311

      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

      Further Reading

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

                          for (var i = 0; i < $scope.probablePositionsWrapper.probablePositions.goodPositions.length; i++) {
                              signalmapApi.highlightTile($scope.probablePositionsWrapper.probablePositions.goodPositions[i].x, $scope.probablePositionsWrapper.probablePositions.goodPositions[i].y, 'good');
                          }
      Severity: Major
      Found in src/main/webapp/js/positioning.js and 1 other location - About 2 hrs to fix
      src/main/webapp/js/positioning.js on lines 306..308

      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

      Further Reading

      Statistics has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class Statistics extends SimpleStatistics {
          private Double geometricMean = 0d;
          private Double skewness = 0d;
          private Double kurtosis = 0d;
          private Double sum = 0d;

        SensorNetwork has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class SensorNetwork extends TypeAbleCouchDBDocument implements Comparable<SensorNetwork> {
            private String networkId;
            private String networkName;
            private String description;
            private Date createDate;

          File ServerUtil.java has 280 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          package at.ac.tuwien.inso.indoor.sensorserver.util;
          
          import at.ac.tuwien.inso.indoor.sensorserver.services.exceptions.InvalidAPICallException;
          import com.fasterxml.jackson.databind.JsonNode;
          import com.fasterxml.jackson.databind.ObjectMapper;

            JobLog has 24 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class JobLog extends TypeAbleCouchDBDocument {
                public enum Status {
                    CREATED,
                    RUNNING,
                    ERROR,
              Severity
              Category
              Status
              Source
              Language