patrickfav/indoor-positioning

View on GitHub

Showing 365 of 365 total issues

Method calculate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public SignalMap calculate() {
        log.debug("start calculating with spread " + spreadCm);

        int halfAddedMatrixTiles = PosHelper.toTiles(calculationMatrixLengthCm / 2, tileLengthCm);
        int tileLengthX = signalMap.getLengthX() + (2 * halfAddedMatrixTiles);

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

    private Map<String, PhysicalAdapter> createPhysicalAdapterMap(String networkId) {
        Map<String, PhysicalAdapter> physicalAdapterMap = new HashMap<String, PhysicalAdapter>();

        for (SensorNode node : SensorManager.getInstance().getAllNodesFromNetwork(networkId)) {
            for (Adapter adapter : node.getAdapters()) {

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

    public static List<SurveyStatistics> createAverageFromSurveys(List<Survey> surveys, String networkId) {
        Map<String, SurveyStatistics> map = new HashMap<String, SurveyStatistics>();

        for (Survey survey : surveys) {
            for (AverageWlanScanMeasurement avgM : survey.getAverageScanNodes()) {
Severity: Minor
Found in src/main/java/at/ac/tuwien/inso/indoor/sensorserver/util/SurveyUtil.java - About 25 mins 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

Method addSensorNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public void addSensorNode(SensorNode node) {
        Iterator<Adapter> iter = node.getAdapters().iterator();
        while (iter.hasNext()) {
            if (!iter.next().getMode().equalsIgnoreCase(ApiConst.OpenWrtConst.MODE_MASTER)) {
                iter.remove();

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

    private static void setProbabilitySpread(final int x, final int y, SparseObjectMatrix2D matrix, String macSrc, String macTarget, Double baseProb, int spread) {
        List<Double> probabilities = new ArrayList<Double>();

        for (int i = 0; i < spread; i++) {
            probabilities.add(getCDFNormalDistribution(i, 0, i == 0 ? 0.4 : i));

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