patrickfav/indoor-positioning

View on GitHub

Showing 193 of 365 total issues

Consider simplifying this complex logical expression.
Open

        if (channel == 34 || channel == 36 || channel == 38 || channel == 40 || channel == 42 ||
                channel == 44 || channel == 46 || channel == 48 || channel == 52 || channel == 56 ||
                channel == 60 || channel == 64 || channel == 100 || channel == 104 || channel == 108 ||
                channel == 112 || channel == 116 || channel == 120 || channel == 124 || channel == 128 ||
                channel == 132 || channel == 136 || channel == 140 || channel == 149 || channel == 153 ||
Severity: Critical
Found in src/main/java/at/ac/tuwien/inso/indoor/sensorserver/util/RadioUtil.java - About 1 day to fix

    File node-detail.js has 468 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    angular.module('adminConsoleApp').controller('NodeDetailCtrl', ['$scope', '$http', 'navStatus', '$routeParams', '$modal', function ($scope, $http, navStatus, $routeParams, $modal) {
    
        $scope.networkId = "";
    Severity: Minor
    Found in src/main/webapp/js/node-detail.js - About 7 hrs to fix

      Method createTrendInfo has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

          private ExtendedNodeInfo.TrendInfo createTrendInfo(String scanNodeMac, ExtendedNodeInfo.ManagedNode managedNode, String networkId) {
              ExtendedNodeInfo.TrendInfo trendInfo = new ExtendedNodeInfo.TrendInfo();
      
              if (prevAnalysis != null && !prevAnalysis.isEmpty()) {
                  List<Double> prevValues = new ArrayList<Double>();

      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 34 (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

      File pathloss-edit.js has 375 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      (function() {
          'use strict';
      
          angular.module('adminConsoleApp').controller('PathLossModalCtrl', ['$scope', '$http', 'navStatus','$modalInstance','analysisService','$rootScope','localStorageService',
              function ($scope, $http, navStatus,$modalInstance,analysisService,$rootScope,localStorageService) {
      Severity: Minor
      Found in src/main/webapp/js/pathloss-edit.js - About 5 hrs to fix

        Method parseSpecificIwinfoAdapter has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            public static IwinfoAdapter parseSpecificIwinfoAdapter(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

        Method getAverageFromSurvey has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            private static SurveyStatistics getAverageFromSurvey(List<Survey> surveys, String macAddress, EFrequencyRange frequencyRange, String networkId) {
                SensorNetwork sensorNetwork = SensorManager.getInstance().getSensorNetworkById(networkId);
        
                SurveyStatistics avgSurvey = new SurveyStatistics();
                avgSurvey.setMacAddress(macAddress);

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

            private Map<String, ExtendedNodeInfo> fillMap(String networkId, Map<String, PhysicalAdapter> physicalAdapterMap, List<Survey> surveyList) {
                Map<String, ExtendedNodeInfo> extendedNodeMap = new HashMap<String, ExtendedNodeInfo>();
        
                SensorNetwork sensorNetwork = SensorManager.getInstance().getSensorNetworkById(networkId);
                RoomList roomList = MiscManager.getInstance().getRoomlistByNetworkId(networkId);

        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

        MiscManager has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class MiscManager extends AManager {
        
            private static Logger log = LogManager.getLogger(MiscManager.class);
            private static MiscManager instance;
        
        

          SensorNode has 35 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class SensorNode extends TypeAbleCouchDBDocument {
          
              private String nodeId;
              private String networkId;
              private String nodeName;

            Function loadSurveys has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function loadSurveys(adapter) {
                    navStatus.startLoading();
                    if ($scope.surveys[adapter] != undefined) {
                        $scope.surveys[adapter].surveyChartConfig.loading = true;
                    } else {
            Severity: Major
            Found in src/main/webapp/js/node-detail.js - About 4 hrs to fix

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

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

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

                Severity
                Category
                Status
                Source
                Language