Skip to content

Non-meaningful variable names in data dependencies to class members #761

@lukasrothenberger

Description

@lukasrothenberger

Example:

a_1.cpp

#include <iostream>
#include "a_2.hpp"

int test() {
    return 2;
}

int main()
{
    int aa = 3;
    int bb = 6;
    int cc = 4;

    if (aa <= 3) {
        bb = cc + 
        aa;
    }

    aa = bb;
    aa = test();
    A2 a2(42);
    A2 a4(44);
    return 0;
}

a_2.hpp

#ifndef A2_H
#define A2_H

class A2
{
public:
    explicit A2(int value)
        : _value(value)
    {
    }

    int getValue() const
    {
        return _value;
    }

private:
    int _value;
};

#endif

FileMapping.txt:

1	a_1.cpp
2	a_2.hpp

Static dependencies:

...
2:7 NOM RAW 2:7|this(S-1864262955)
2:8 NOM RAW 2:7|value(S-1864262956)
...

Problem: this and value are not really meaningful reported variable names. Furthermore, no connection to the original occurrence in file 1 is obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions