Skip to content

Commit 98461fe

Browse files
committed
study of clang-tidy issues and report to JB support
1 parent 91e831a commit 98461fe

11 files changed

Lines changed: 38 additions & 2 deletions

File tree

clang-tidy-debug/1.png

303 KB
Loading

clang-tidy-debug/2.png

322 KB
Loading

clang-tidy-debug/3.png

208 KB
Loading

clang-tidy-debug/4.png

211 KB
Loading

clang-tidy-debug/5.png

32.9 KB
Loading
Binary file not shown.

core/BranchConfig.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class BranchConfig : public VectorConfig<int>, public VectorConfig<float>, publi
145145

146146
template<typename T>
147147
ANALYSISTREE_ATTR_NODISCARD std::vector<std::string> GetFieldsNamesT() const {
148+
int abc{5}; // does not highlight unused variable
148149
std::vector<std::string> result;
149150
std::transform(begin(GetMap<T>()), end(GetMap<T>()), back_inserter(result),
150151
[](const typename MapType::value_type& elem) { return elem.first; });
@@ -164,6 +165,9 @@ class BranchConfig : public VectorConfig<int>, public VectorConfig<float>, publi
164165

165166
bool HasField(const std::string& field) const { return GetFieldId(field) != UndefValueShort; }
166167

168+
void PrintHello() { std::cout << "Hello"; } // does not highlight neither unused function nor proposal to make static
169+
void PrintName() { std::cout << name_; } // does not highlight neither unused function nor proposal to make const
170+
167171
protected:
168172
void GenerateId();
169173

core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ set(SOURCES
1010
Container.cpp
1111
DataHeader.cpp
1212
Matching.cpp
13-
Particle.cpp)
13+
Particle.cpp
14+
MyClass1.cpp)
1415

1516
string(REPLACE ".cpp" ".hpp" HEADERS "${SOURCES}")
1617
list(APPEND HEADERS "Constants.hpp" "Detector.hpp")

core/MyClass1.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//
2+
// Created by oleksii on 11.07.25.
3+
//
4+
5+
#include "MyClass1.hpp"

core/MyClass1.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Created by oleksii on 11.07.25.
3+
//
4+
5+
#ifndef ANALYSISTREE_MYCLASS1_H
6+
#define ANALYSISTREE_MYCLASS1_H
7+
8+
#include <iostream>
9+
#include <string>
10+
11+
class MyClass1 { // highlights unused class
12+
public:
13+
14+
void PrintHello() { std::cout << "Hello"; } // highlights unused function (gray) and proposal to make static (yellow)
15+
void PrintName() { std::cout << fName; } // highlights unused function (gray) however NO proposal to make const
16+
17+
private:
18+
std::string fName;
19+
int fNumber; // highlights unused class member
20+
};
21+
22+
#endif//ANALYSISTREE_MYCLASS1_H

0 commit comments

Comments
 (0)