Skip to content

Conversation

@nowaits
Copy link

@nowaits nowaits commented Dec 19, 2018

如下目录装不会生成分析结果

cd /tmp/root/TscanCode/samples/cpp
/tmp/root/TscanCode/trunk/tscancode --enable=all --debug -j1 --xml $PWD

Copy link

@Imran-imtiaz48 Imran-imtiaz48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

The recent modifications focus on changing the initialization and iteration logic involving the root folder. Here are the key points of the review:

  1. Initialization of m_pRoot:

    • The root folder is now initialized with an empty string instead of "root". This can be beneficial for avoiding hardcoded values and improving flexibility.
  2. Iteration Logic:

    • The while loop condition is simplified to only check for the presence of pFile rather than also checking if the name is not "root".

Improvement Suggestions

  1. Clarify the Purpose of Root Initialization:
    • Ensure the empty string initialization for m_pRoot is intended and documented. This helps future developers understand the rationale behind this change.
// Initialize root folder with an empty name for flexibility
m_pRoot = new CFolder("");
  1. Consistent Naming Conventions:

    • Verify that all related methods and variables adhere to the updated logic to avoid potential inconsistencies.
  2. Error Handling and Validation:

    • Add error handling or validation if m_pRoot must not remain an empty string for specific operations.

Summary

The changes made improve the flexibility and simplicity of the initialization and iteration logic. Implementing the suggested improvements, such as documenting the initialization logic and ensuring consistency, will further enhance the code's clarity and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants