Code Monkey home page Code Monkey logo

cpp-dependencies's Introduction

Read Me for Dependency Checker

Codacy Badge Mac/Linux Build Status Windows Build Status License Release

Snap store badge

Copyright (C) 2012-2017, TomTom International BV. All rights reserved.

The tool cpp-dependencies creates #include dependency information for C++ source code files, which it derives from scanning a full source tree.

The dependency information is output as .dot files, which can be visualized in, for example, GraphViz.

Happy coding!

Peter Bindels and Rijn Buve

TomTom International BV

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Build and run

The tool depends on Boost.Filesystem being available and usable. Installing this should be done with your platform's package management system, such as Apt, Pacman or Brew.

The build configuration is created with CMake. To create the build configuration for your build system (GNU make, MSBuild/Visual Studio) create a build directory outside this source directory and run

cmake <PATH_TO_THIS_SOURCE_DIR>

If you want to use Boost::Filesystem instead of std::filesystem, if your platform does not have a std::filesystem implementation yet or if you prefer it, add -DWITH_BOOST to the invocation of CMake.

To build the tool, either execute

make

for GNU make or open the Visual Studio solution file generated in the build directory.

This creates the executable file cpp-dependencies.

To check if the tool was compiled correctly, execute:

./cpp-dependencies

This provides help information about the tool. More information about its usage is presented in the next paragraph.

Using cpp-dependencies to analyze a component

As a first thing on a code base is to find out whether it can read the code correctly. From the root of the project, run the command:

cpp-dependencies --stats .

to determine the complexity of the code base and the amount of nodes that are entangled in cycles with other components. In well set-up projects, the cycle count will be equal to zero and the amount of components will be in the same order of size as the logical components you expect.

To investigate a specific component, you can use

cpp-dependencies --info <component> .

for all information the tool has on the component, or:

cpp-dependencies --inout <component> .

to find out who links to and from your component.

In case you have a dependency that you were not expecting, or find out that when rebuilding component A that a supposedly-unrelated component B is built, you can use:

cpp-dependencies --shortest A B .

to determine why there is a link from component A to component B. It will find one of the shortest paths it can find from A to B if there is one.

Using cpp-dependencies to make visualized graphs

The tool is also able to provide output in .dot format, which is a format used by GraphViz and other tools to contain graphs. It is a human-readable format and can be used by the dot tool to convert it into a graphical image. To create a graph file, use:

cpp-dependencies --graph mygraph.dot .

to create a mygraph.dot file containing the full component graph.

You can restrict the component graph to either all components beneath a given target (--graph-for <output> <target>) or all components part of a cycle (--graph-cycles).

To make this text-format graph into a viewable graph, use for example:

dot -Tpng mygraph.dot >mygraph.png

to convert it into a PNG file.

The dot program will try to find a way to graphically display the graph output. Note that very large graphs, in particular if many cycles are present, can take hours to render.

Example use of cpp-dependencies

In the source tree there's a folder example which contains an empty skeleton project, which does have some dependency information to be extracted from it. To start analyzing it, we first run the tool to extract statistics:

> cpp-dependencies --dir example --stats
6 components with 5 public dependencies, 1 private dependencies
Detected 2 nodes in cycles

This informs us that there is something not quite right with the dependencies. It sees 6 components: the root folder, four libraries and an executable. The simplest way to find out what's wrong is to draw out the graph in a visual way:

> cpp-dependencies --dir example --graph dependencies.dot
> dot -Tpng dependencies.dot >dependencies.png

Then open this PNG file in any tool that can view it, such as a web browser. This shows us the following image:

Dependency graph showing a cycle between Engine and UI

The light blue links are an implementation-only link, the dark blue ones expose some part of this dependency on their interface. The orange ones are the most interesting ones; they are places where a component can reach itself through some other component. Let's find out why this is there:

> cpp-dependencies --dir example --shortest Engine UI
Engine -> UI
  ./Engine/Engine.h includes ./UI/Display.h
> cpp-dependencies --dir example --shortest UI Engine
UI -> Engine
  ./UI/Display.cpp includes ./Engine/Engine.h
  ./UI/Display.h includes ./Engine/Engine.h

At this point, it's up to the developer or architect to find out which of these two dependencies is the wrong way around and to find a way around that. In the example, the Engine component should not be talking directly to the UI component. Removing this dependency results in the following statistics:

> cpp-dependencies --dir example --stats
6 components with 4 public dependencies, 2 private dependencies
Detected 0 nodes in cycles

The cycle has been removed, and there is one less dependency. We can find out what the shortest path is to the DataAccess component from the executable:

> cpp-dependencies --dir example --shortest main DataAccess
main -> UI
  ./main/main.cpp includes ./UI/Display.h
UI -> Engine
  ./UI/Display.cpp includes ./Engine/Engine.h
  ./UI/Display.h includes ./Engine/Engine.h
Engine -> DataAccess
  ./Engine/Engine.cpp includes ./DataAccess/DA.h

This tells us that there's no path shorter than three steps, and it informs us for each step of the way why it detects this link. In more complicated cycles, this can be a way to isolate the thinnest part of the cycle. In situations where there's an invalid dependency from one component to another - for example, from a unit test of one component to a very far away different component, this can help you identify where on the path from A to B a wrong link is present. It can also be used to explicitly verify that a link is not present, such as the one we just removed:

> cpp-dependencies --dir example --shortest Engine UI
No path could be found from Engine to UI

The graph now also shows proper dependency ordering:

> cpp-dependencies --dir example --graph newdependencies.dot
> dot -Tpng newdependencies.dot >newdependencies.png

Dependency graph showing no more cycles

We can regenerate the CMakeLists.txt files as well to remove the dependency from the build inputs, so that our build system will also know that the link is no longer present:

> cpp-dependencies --dir example --dryregen
Difference detected at "./Engine"
> cpp-dependencies --dir example --regen

Customizing the outputs

As cpp-dependencies has a lot of analysis it can do on the source tree, there are also some configurable parts to it. The configuration can be found in the file config-cpp-dependencies.txt that should be in your project root. It allows you to customize the colors used in generation, the thresholds for outlier detection and some minor parameters. Please read the documentation in the example config-cpp-dependencies.txt that is in the source distribution for the tool to see all the options.

Editing the tool

The tool itself is split up into a few separate files to make it easier to find and extend its functionality. The following files are found:

  • main.cpp contains the main functions and help information, as well as the core flow.
  • Input.cpp contains the functions that read C++ and CMakeLists files into the information needed by the tool.
  • Output.cpp contains functions to write all output files generated, except for the CMakeLists generation.
  • CmakeRegen.cpp contains the functionality to write CMakeLists files.
  • Analysis.cpp contains all graph processing and navigation functions.
  • Component.cpp contains the implementation needed for the struct-like data storage classes.
  • generated.cpp contains the function to convert found header files into a lookup map. Also the place to add generated files to the known file list, so that they will be taken into account for components.
  • Constants.h contains the constants used throughout the code base.

In general, the root functionality is kept in main.cpp, the structural classes are kept in Component.cpp and any auxiliary functions that are used to do this are split up by domain.

Rationale behind implementation

The tool was implemented with the goal of being able to quickly analyze dependencies between components of a complex project, including how the dependency graph changes when some changes are made to the source tree. To accomplish this, choices were made in the direction of more performance at the expense of strict correctness. Specifically:

  • It does not use a proper C++ parser to read C++ files, nor a proper CMake parser to read CMake files. Properly parsing these files would increase the full run time of the program by orders of magnitude and make it much less useful.
  • strstr is used across the full code base. While profiling, we found that std::string::find was taking over 80% of the full runtime. Replacing it with strstr, which is typically much more optimized, made the whole program twice as fast.

This results in it running on a 1.5GB source code base in about 2.1 seconds -- fast enough for interactive checks and rerunning after any small modification.

The tool was set up to compile on a Ubuntu 12.04 system with the platform default compiler. This means that the sources will use C++11 but will not use anything not available in GCC 4.6. It has been tested and used on Linux (Ubuntu 12.04 - 16.04) and MacOS X (different versions).

Using Git and .gitignore

It's good practice to set up a personal global .gitignore file on your machine which filters a number of files on your file systems that you do not wish to submit to the Git repository. You can set up your own global ~/.gitignore file by executing: git config --global core.excludesfile ~/.gitignore

In general, add the following file types to ~/.gitignore (each entry should be on a separate line): *.com *.class *.dll *.exe *.o *.so *.log *.sql *.sqlite *.tlog *.epoch *.swp *.hprof *.hprof.index *.releaseBackup *~

The local .gitignore file in the Git repository itself to reflect those file only that are produced by executing regular compile, build or release commands.

Bug reports and new feature requests

If you encounter any problems with this library, don't hesitate to use the Issues session to file your issues. Normally, one of our developers should be able to comment on them and fix.

cpp-dependencies's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp-dependencies's Issues

Make very explicit what the tool does with CMakeLists

I started using the tool on my codebase recently and for some components I could make some improvements already.

But with bigger contexts the tool still struggles. I tried to find out why. As far as I can see, the tool is not able to handle the INCLUDE() Cmake directive correctly, so some crucial targets are missing and my depedency graph is wonky.

Is this support indeed missing?
Where would on start adding it?

std::bad_alloc (core dumped) on Ubuntu 16.04

Build went fine on Ubuntu 16.04
But execution failed
/usr/local/bin/cpp-dependencies --stats . terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

PrintF not working correctly on mingw64

While compiling went smoothly, g++ threw lots of warnings saying that it had "unknown conversion type character"s in a lot of the printf statements. Here are the errors:

$ make
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/main.o src/main.cpp -std=c++11 -O3
src/main.cpp: In lambda function:
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
                     components.size(), totalPublicLinks, totalPrivateLinks);
                                                                           ^
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:91:75: warning: too many arguments for format [-Wformat-extra-args]
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:91:75: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:91:75: warning: too many arguments for format [-Wformat-extra-args]
src/main.cpp:93:80: warning: unknown conversion type character 'z' in format [-Wformat=]
             fprintf(stderr, "Detected %zu nodes in cycles\n", NodesWithCycles());
                                                                                ^
src/main.cpp:93:80: warning: too many arguments for format [-Wformat-extra-args]
src/main.cpp:93:80: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:93:80: warning: too many arguments for format [-Wformat-extra-args]
src/main.cpp: In function 'int main(int, char**)':
src/main.cpp:275:72: warning: unknown conversion type character 'z' in format [-Wformat=]
             printf("Found %zu ambiguous includes\n\n", ambiguous.size());
                                                                        ^
src/main.cpp:275:72: warning: too many arguments for format [-Wformat-extra-args]
src/main.cpp:275:72: warning: unknown conversion type character 'z' in format [-Wformat=]
src/main.cpp:275:72: warning: too many arguments for format [-Wformat-extra-args]
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/Component.o src/Component.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/Configuration.o src/Configuration.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/generated.o src/generated.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/Input.o src/Input.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/Output.o src/Output.cpp -std=c++11 -O3
src/Output.cpp: In function 'void PrintLinksForTarget(Component*)':
src/Output.cpp:178:57: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("Public linked (%zu):", sortedPubLinks.size());
                                                         ^
src/Output.cpp:178:57: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:178:57: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:178:57: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:184:61: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("\nPrivate linked (%zu):", sortedPrivLinks.size());
                                                             ^
src/Output.cpp:184:61: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:184:61: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:184:61: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp: In function 'void PrintInfoOnTarget(Component*)':
src/Output.cpp:199:44: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("Lines of Code: %zu\n", c->loc());
                                            ^
src/Output.cpp:199:44: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:199:44: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:199:44: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:204:63: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("Public dependencies (%zu): ", sortedPubDeps.size());
                                                               ^
src/Output.cpp:204:63: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:204:63: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:204:63: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:209:66: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("\nPrivate dependencies (%zu):", sortedPrivDeps.size());
                                                                  ^
src/Output.cpp:209:66: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:209:66: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:209:66: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:217:45: warning: unknown conversion type character 'z' in format [-Wformat=]
     printf("\nFiles (%zu):", c->files.size());
                                             ^
src/Output.cpp:217:45: warning: too many arguments for format [-Wformat-extra-args]
src/Output.cpp:217:45: warning: unknown conversion type character 'z' in format [-Wformat=]
src/Output.cpp:217:45: warning: too many arguments for format [-Wformat-extra-args]
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/CmakeRegen.o src/CmakeRegen.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -c -Wall -Wextra -Wpedantic -o obj/Analysis.o src/Analysis.cpp -std=c++11 -O3
/c/msys64/mingw64/bin/g++.exe -o cpp-dependencies obj/main.o obj/Component.o obj/Configuration.o obj/generated.o obj/Input.o obj/Output.o obj/CmakeRegen.o obj/Analysis.o -lboost_filesystem-mt -lboost_system-mt -O3

After compilation, the output of cpp-dependencies.exe" --stats is:

zu components with zu public dependencies, zu private dependencies Detected zu nodes in cycles

I compiled it using the following compiler:

$ /c/msys64/mingw64/bin/g++.exe --version
g++.exe (Rev1, Built by MSYS2 project) 6.1.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Support Mac OS X

In Input.cpp, the Linux function memrchr() is used. This is a non-standard function, and should be east to replace by something more portable.

CMakeLists.txt files in subdirectories are unconditionally included in analysis

CMakeLists.txt files in subdirectories, like those from submodules, are included in analysis regardless of whether they are in the transitive-include graph of the top-level CMakeLists.txt file.

src/Input.cpp L 267 will pull in any file named CMakeLists.txt.

This results in misdiagnosis of ambiguous includes in projects like https://github.com/jbcoe/polymorphic_value which include the popular Catch testing framework.

Add unit tests

Many parts of the tool are logical operations and can be unit-tested. So far they just haven't been.

No such file or directory error

I am getting this error

cpp-dependencies-1.1/example/Engine/./Engine.h:1:33: fatal error: Framework/framework.h: No such file or directory
#include "Framework/framework.h"

when calling "make" after "cmake example"

What am I doing wrong can you help me?

Cannot scan libwebp due to parenthesis level check

Hi,

this is follow up of #57 . The fix provided doesn't help for all projects I use.
In particular running cpp-dependecies over libwebp causes the issue:

$ cpp-dependencies --stats
final level of parentheses=7
cpp-dependencies: /build/cpp-dependencies/parts/cpp-depenencies/src/src/Input.cpp:310: void ReadCmakelist(const Configuration&, std::unordered_map<std::__cxx11::basic_string<char>, Component*>&, const boost::filesystem::path&): Assertion `parenLevel == 0 || (printf("final level of parentheses=%d\n", parenLevel), 0)' failed.
Aborted (core dumped)

Project code:

https://github.com/webmproject/libwebp / tag v1.2.4 (current HEAD also fails)

It worth noting that before the #61 final level of parentheses was 1 (not 7).
And it was possible to overcome the issue by modifying following line in CMakeLists.txt of libwebp:

405: "AC_INIT\\([^\n]*\\[[0-9\\.]+\\]"

to

405: "AC_INIT\\([^\n]*\\[[0-9\\.]+\\]\\)"

With recent changes this no longer works.

Warn if no sensible project(s) could be found

For new users it's confusing if it says there's one component when there are others, but it only won't find it because there are no cmakelists or other supported project files. Instead, tell the user explicitly that it didn't find anything because of this.

Does it support bazel build system ?

I am using Bazel build system for my c++ project and i was trying to generate the dependency graphs for the project. After running the tool, it showed me this error:

Warning: Analyzing your project resulted in a very low amount of components. This either points to a small project, or
to cpp-dependencies not recognizing the components.

It tries to recognize components by the existence of project build files - CMakeLists.txt, Makefiles, MyProject.vcxproj
or similar files. If it does not recognize any such files, it will assume everything belongs to the project it is
contained in. You can invert this behaviour to assume that any code file will belong to a component local to it - in
effect, making every folder of code a single component - by using the --infer option.

Another reason for this warning may be running the tool in a folder that doesn't have any code. You can either change
to the desired directory, or use the --dir <myProject> option to make it analyze another directory.

Clarify purpose and status of this repository

IMPORTANT PLEASE READ: NO RESPONSE WILL RESULT IN REPO ARCHIVAL AND FINALLY DELETION

Dear maintainer,

One important topic in our TomTom open source engineering community is to make our public organization on GitHub, as well as the repositories hosted on it, more welcoming to contributors. That process starts which making it easy for other to understand the purpose of a codebase is and how people can contribute.

In order to do so we want to learn which repo's are still actively maintained and important to keep available to the open source community and which are not. We have therefore decided to start a clean-up proces which will be done as follows:

  1. Please respond to this issue within 30 days and provide us with the necessary information requested below.
  2. If there is no reply to this issue after these 30 days, the repository will be archived
  3. After your repo has been archived you have an additional 30 days to respond and provide information and discuss with us whether you want to revert, or keep archived status.
  4. IMPORTANT After the above mentioned additional 30 days no response is given the repository will be removed from the TomTom-International organization or will be DELETED

Could you please be so kind to provide us with the following information

Contact details

Repo owner/primary contact: [please provide email address]

Repository details

Describe the purpose/objective of this codebase in 1-5 sentences:
[enter description here]

Please select how this repository contributes to the following (thick all that apply):

  • Internal use: The code is used inside TomTom and there is a vested interest in long term maintenance
  • Employer branding: Project gives an insight into the scale and problem-solving of TomTom tech.
  • Hiring: contributors and users of the project could be attractive job candidates
  • Learning: TomTom employees can collaborate with and learn from external experts on the topic
  • Enhancement: the project could gain new functionality and refinement by external use and contribution
  • Product: The project is needed to make our tech or products integrate with other products or tech stacks
  • License Compliance
  • Fork: Fork needed for for upstream contributions, long-term upstream collaboration or product / CI/CD pipeline dependency or other need. If this is the case you can move your fork to a new GitHub organization https://github.com/tomtom-forks. If you need access to this org reach out at the #ospo channel on slack with your TomTom Github user account.

Additional context information about the purpose of this codebase:
[enter addition info here]

Questions?

Please respond to this issue or drop a line to [email protected] mentioning this issue nr.
Or for TomTom'ers reach out on the #ospo slack channel.

Thanks so much for helping keep our public repositories up to date and welcoming to all contributors.

Release pre-built binaries for Linux/MacOS/Windows

Hi,

I think this is a great tool and it would be even better if pre-built binaries were packaged up as releases (can be done automatically by the CI when a new release is made).

I personally feel it is unreasonable to expect every user to compile the tool from source in order to use it.

Thanks.

boost dependency necessary for Linux?

Great tool! The project's README says C++ Boost's Filesystem is necessary, but the file "src/FilesystemInclude.h" gives an alternative("experimental") by a conditional directive.
On Linux, there is indeed an "experimental" directory inside GCC's include directory.
So is this necessary for Linux? Installing boost seems not a cakewalk (at least for me).

Assertion failed in src/Input.cpp:304

final level of parentheses=-1
cpp-dependencies: ../src/Input.cpp:304: void ReadCmakelist(const Configuration&, std::unordered_map<std::__cxx11::basic_string<char>, Component*>&, const boost::filesystem::path&): Assertion `parenLevel == 0 || (printf("final level of parentheses=%d\n", parenLevel), 0)' failed.
Aborted (core dumped)

Be nice to clearly state that you need to be using CMake

The README didn't make it clear to me that it needs CMakeLists.txt to do anything useful. I managed to get it building on WIndows but our code uses MSVC projects so all I got was:

1 components with 0 public dependencies, 0 private dependencies
Detected 0 nodes in cycles

CMake Error about "Could NOT find Boost (missing: Boost_INCLUDE_DIR filesystem system)"

I clone the source code from github and run the command cmake cpp-dependencies. Then, the cmake print error below

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR filesystem system)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
  CMakeLists.txt:76 (find_package)

assertion failed in ReadCmakelist while running cpp-dependencies on itself

Running cpp-dependencies on itself results in a failure:

../build/src/cpp-dependencies --stats .
final level of parentheses=1
cpp-dependencies: /work/cpp-dep_ws/cpp-dependencies/src/Input.cpp:310: void ReadCmakelist(const Configuration&, std::unordered_map<std::__cxx11::basic_string, Component*>&, const boost::filesystem::path&): Assertion `parenLevel == 0 || (printf("final level of parentheses=%d\n", parenLevel), 0)' failed.
Aborted (core dumped)

Specifying directories to exclude from the analysis

Hi,

I've just started using the tool an a fair sized legacy codebase and am immediately getting some interesting results (GREAT tool thanks). Unfortunately a near full version of boost is contained inside the root directory of the codebase which can't be helping the performance of the parser and is also adding noise to the results.

It would be nice to specify a (list of) directories that should be excluded from the the analysis (including all subdirectories).

#include finding is not robust and has false positives and false negatives

This is a known issue.

It assumes that there will be no white space between the hash character and the "include" keyword.

It also does not understand the /* ... */ comments and will consider include statements between them as actual includes.

To fix this would require a fairly hefty rewrite of the C++ source file reading.

Consider adding travis shields to README

You may wish to consider adding shields to your README to indicate successful builds and/or test coverage. (For example, check the README.md in the SpeedTools repo on how to use such shields.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.