Skip to content

Commit

Permalink
fix: precommit
Browse files Browse the repository at this point in the history
Signed-off-by: tzhong518 <[email protected]>
  • Loading branch information
tzhong518 committed Dec 14, 2023
1 parent 643e52d commit 43c347e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion perception/traffic_light_fine_detector/src/nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ bool TrafficLightFineDetectorNodelet::fitInFrame(
bool TrafficLightFineDetectorNodelet::readLabelFile(
const std::string & filepath, std::vector<int> & tlr_label_id_, int & num_class)
{
// tlr_label_id_ = -1;
std::ifstream labelsFile(filepath);
if (!labelsFile.is_open()) {
RCLCPP_ERROR(this->get_logger(), "Could not open label file. [%s]", filepath.c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ void TrafficLightOcclusionPredictorNodelet::syncCallback(
std::vector<int> occlusion_ratios;
if (in_cloud_msg == nullptr || in_cam_info_msg == nullptr || in_roi_msg == nullptr) {

Check notice on line 128 in perception/traffic_light_occlusion_predictor/src/nodelet.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Conditional

TrafficLightOcclusionPredictorNodelet::syncCallback decreases from 1 complex conditionals with 3 branches to 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
occlusion_ratios.resize(in_signal_msg->signals.size(), 0);
// return;
} else {
tier4_perception_msgs::msg::TrafficLightRoiArray selected_roi_msg;
selected_roi_msg.rois.reserve(in_roi_msg->rois.size());
Expand Down

0 comments on commit 43c347e

Please sign in to comment.