Git Product home page Git Product logo

ericsson / codecompass Goto Github PK

View Code? Open in Web Editor NEW
501.0 35.0 97.0 82.51 MB

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java

Home Page: https://codecompass.net

License: GNU General Public License v3.0

HTML 0.72% C++ 42.13% Thrift 1.85% Java 9.77% C 10.42% Python 0.04% JavaScript 14.77% CSS 2.55% CMake 3.89% Shell 1.22% Dockerfile 0.40% TypeScript 12.23% SCSS 0.01%
static-analysis code-comprehension cpp java

codecompass's People

Contributors

andocz avatar bruntib avatar chillthrower avatar csordasmarton avatar cwharvey avatar dbukki avatar dependabot[bot] avatar dutow avatar fardas avatar filbeofitk avatar gamesh411 avatar gkunz avatar intjftw avatar kalfou avatar kmkristof avatar loremipsummer avatar matebelenyesi avatar mcserep avatar mdeme01 avatar mozesl avatar rpoisel avatar schaumb avatar seeker04 avatar wbqpk3 avatar whisperity avatar wrathan avatar zomen2 avatar zporky avatar

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

codecompass's Issues

Error when building on Ubuntu 16.04.1 LTS (Xenial Xerus)

I've followed instructions but when building I got this error:

[...]
libtool: warning: '/home/ovi/cc/CodeCompass-deps/lib/../lib64/libstdc++.la' seems to be moved
libtool: warning: '/home/ovi/cc/CodeCompass-deps/lib/../lib64/libstdc++.la' seems to be moved
libtool: warning: '/home/ovi/cc/CodeCompass-deps/lib/../lib64/libstdc++.la' seems to be moved
[...]
make all-am
make[1]: Entering directory '/home/john/cc/CodeCompass'
make[1]: *** No rule to make target '/home/john/cc/CodeCompass/lib/java/commons-cli-1.3.1.jar', needed by 'all-am'. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/ovi/cc/CodeCompass'
Makefile:3780: recipe for target 'all' failed
make: *** [all] Error 2

Any ideea what could be wrong?

Tag table for cpp entities

Create a table for tags(CppTag) to store some extra information for CppEntity's(ctor, dtor, virt, pod, etc.). Then we can remove the CppFunction, CppType etc. tables.

Xerces library link broken

Hello guys, I was encountered with problem during compilation.
Here what ./configure said to me:

checking for Xerces C++ Parser headers in /usr/src/cc/CodeCompass-deps/include and /usr/src/cc/CodeCompass-deps/include/xercesc... not found
checking for Xerces C++ Parser... no
configure: error: cannot find the Apache Xerces library

I strictly follow instructions from this page: https://github.com/Ericsson/CodeCompass/wiki/Lazy-Dog.
And dependencies building finished without problems.
But it looks like there is really no xerces includes in CodeCompass-deps tree.

UPD:
I examined build-deps.sh and found that link in build_xercesc is broken http://xenia.sote.hu/ftp/mirrors/www.apache.org/xerces/c/3/sources/xerces-c-3.1.1.tar.gz, returns 404 result.

CodeCompass build doesn't work

Hi,

I'm following the steps described here: https://github.com/Ericsson/CodeCompass/wiki/How-To-Build-Codecompass ― I'm using Fedora 24.

When running the CodeCompass/scripts/build_deps.sh script it seems to me that it appears to download and build GCC 4.9.3. I'm not sure why it needs to build such an old version of GCC, but unfortunately the build fails. (I have GCC 6.2.1 installed, and maybe they didn't think about using it to build an older version of GCC...)

Here is the relevant part of the log:

g++ -c  -DIN_GCC_FRONTEND -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Icp -I../.././gcc -I../.././gcc/cp -I../.././gcc/../include -I../.././gcc/../libcpp/include -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/host-x86_64-unknown-linux-gnu/gmp -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/gmp -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/host-x86_64-unknown-linux-gnu/mpfr -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/mpfr -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/mpc/src  -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/bid -I../libdecnumber -I../.././gcc/../libbacktrace -DCLOOG_INT_GMP -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/host-x86_64-unknown-linux-gnu/cloog/include -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/cloog/include -I./cloog/include  -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/host-x86_64-unknown-linux-gnu/isl/include -I/home/Timur/Projects/Others/cc/CodeCompass-deps/deps/gcc-4.9.3/isl/include -I/home/Timur/Projects/Others/cc/CodeCompass-deps/usr/include -I/home/Timur/Projects/Others/cc/CodeCompass-deps/include -o cp/init.o -MT cp/init.o -MMD -MP -MF cp/.deps/init.TPo ../.././gcc/cp/init.c
In file included from ./tm.h:27:0,
                 from ../.././gcc/cp/except.c:27:
../.././gcc/config/elfos.h:102:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
    fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
                     ^
../.././gcc/config/elfos.h:170:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
       fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",  \
                        ^
In file included from ./tm.h:45:0,
                 from ../.././gcc/cp/except.c:27:
../.././gcc/defaults.h:126:24: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
       fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",  \
                        ^
In file included from ../.././gcc/cp/except.c:1013:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Makefile:1058: recipe for target 'cp/except.o' failed
make[3]: *** [cp/except.o] Error 1

My question is: is it possible to fix this, or could I build CodeCompass without it building GCC 4.9.3?

Unnecessary parameter for thrift handler

The constructor of ThriftHandler gets a webserver name as a second parameter. As far as I have seen, the Thrift handler does nothing with this parameter. This should be eliminated.

tinyxml exception

If I click on the TiXmlString node in tinystr.h file at 78 line and I get an Info Tree, the Usages will throw an exception. The exception is throwing in the util textRange function.

78. TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) // click on TiXmlString
79. {
80. 	  init( static_cast<size_type>( strlen(copy) ));
81.	      memcpy(start(), copy, length());
82. }

Global javascript context

Create a JavaScript global object to store common information such as file id, fileInfo, url information etc.

We should reconsider some common functions why do they have the given parameter list. For example the modules with type ContextButton have a render() function which is given a FileInfo object. Why FileInfo? What if later something else will also be needed for a plugin? If we think it is likely that these parameters may change in the future then we should get prepared even now. Shouldn't these functions somehow rely on this global context?

Decompose CSS file

The different modules which provide webgui functionality should have separate CSS files.

Interface Diagram

Interface diagram shows the used and provided interfaces of a source code file and shows linking information.

InfoTree empty nodes

I don't think we should show empty reference nodes at InfoTree. We should remove or disable them.

C++ Class Catalogue

It shows the namespaces, classes and their doxygen documentation in a tree.

Revision Control Navigator

The revision control navigator allows to search in the GIT repositories, visualize branches and merges, list and show commit diffs.

Nested class ast nodes

// NestedClass.h
class NestedClass{
public:
  class InnerClass
  {
    static const int staticInt;
    void f(int param_);
  };
private:
  static InnerClass createNestedClass();
};

// NestedClass.cpp
const int NestedClass::InnerClass::staticInt = 1; /*!<  No ast node for InnerClass and NestedClass at this context */

void NestedClass::InnerClass::f(int param_) /*!< 
  1. If I get an Info Tree for InnerClass, it will return the Info Tree of the f function 
  2. If I get an Info Tree for NestedClass, it will return the Info Tree of the InnerClass
  */
{
}

NestedClass::InnerClass NestedClass::createNestedClass() /*!< No ast nodes for NestedClass at both places */
{
  return InnerClass{};
}

build system invocation during parse command

Hi,

How would one make this work with a build system that does not invoke directly gcc or make?

I have a build system driver written in python which in turn calls CMake to generate the makefiles and after it calls make. All of that is done from within python scripts. I have built and installed Code Compass
and I try to parse my project by passing to -b a shell script which calls my python script. My project builds OK, which means the script invocation works but the parser does not parse anything! I instructed it to look for CMake, my python script invocation, gcc and make using export CC_LOGGER_GCC_LIKE="python_script:cmake:make:gcc", but still it does not parse anything.

Do you have any pointers on how I could overcome that?

Empty function virtual call

Function Virtual Call is not working properly.

class Base
{
public:
  virtual void f() = 0;
};

class Derived
{
  virtual void f(){} // f function's Virtual call is empty. 
};

int main()
{
  Derived *d = new Derived();
  d->f(); 

  return 0;
}

SQLite support in the CLI

The command line interface of CodeCompass, i.e. the python script should support SQLite besides PostgreSQL.

Multiple search finding in a line

When there are several findings in a file in the same row then the Query results window contains all of them but clicking any of these jumps to the last occurance in the row.

hello blabla hello

Here we always jump to the second hello.

Cpp macros

The parser doesn't parse the macros. We should support it.

After following installation and parsing guide I got a blank page when accessing the web server

This might not be an issue but a misconfiguration on my part. I've followed all instructions, and I've also tried the ones from lazy dog page but all I get is a blank page and the following debug info in Safari:

http://i.imgur.com/Eyc39OF.png

Here is what I did (after installing required packages and succesfully building codecompass):

start postgresql

/home/john/cc/CodeCompass-deps/bin/postgres -D /home/john/pgsql_data -p 6250 >pgsql_log 2>&1

parse the project

CodeCompass parse -f -w /home/john/cc/workdir -n tinyxml -b "g++ *.cpp -std=c++11" --dbuser john --dbport 6250

start web server

CodeCompass server -w /home/john/cc/workdir -p 6251 --dbport 6250 --dbuser john

No errors are issues on any of those commands.

Thanks for your help and for fixing previous issue, now building of the project went ok.

Here is more info:

INFO CodeCompass: Webserver: [tid: 140659779868480, time: 1477215622] util/src/environment.cpp:143
Detected CodeCompass install path: /home/jonh/cc/CodeCompass-install

Workspace
id = simple_project
connection = pgsql:host=localhost;database=simple_project;user=jonh;port=6250
description = simple_project
datadir = /home/jonh/cc/workdir/simple_project/data

Workspace
id = tinyxml
connection = pgsql:host=localhost;database=tinyxml;user=jonh;port=6250
description = tinyxml
datadir = /home/jonh/cc/workdir/tinyxml/data

DEBUG CodeCompass: Webserver: [tid: 140659779868480, time: 1477215622] webserver/pluginable-webserver/src/userstat.cpp:126
The default root interface is: enp0s3
Mongoose web server v. 5.4, starting on port(s) 6251 with web root [/home/jonh/cc/CodeCompass-install/share/codecompass/html]
Oct 23, 2016 12:40:22 PM cc.search.service.app.service.ServiceApp main
INFO: Search server started!
Oct 23, 2016 12:40:22 PM cc.search.service.app.service.ServiceApp main
INFO: Search server started!
Oct 23, 2016 12:40:22 PM cc.search.suggestion.SuggestionHandler loadDatabases
SEVERE: Failed to load the file name suggestion database!
java.io.EOFException
at org.apache.lucene.store.InputStreamDataInput.readByte(InputStreamDataInput.java:37)
at org.apache.lucene.store.DataInput.readInt(DataInput.java:96)
at org.apache.lucene.codecs.CodecUtil.checkHeader(CodecUtil.java:134)
at org.apache.lucene.util.fst.FST.(FST.java:322)
at org.apache.lucene.util.fst.FST.(FST.java:308)
at org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester.load(AnalyzingSuggester.java:593)
at cc.search.suggestion.SuggestionHandler.loadFileNameSuggester(SuggestionHandler.java:120)
at cc.search.suggestion.SuggestionHandler.loadDatabases(SuggestionHandler.java:47)
at cc.search.service.app.service.SearchHandler.(SearchHandler.java:158)
at cc.search.service.app.service.ServiceApp.(ServiceApp.java:30)
at cc.search.service.app.service.ServiceApp.main(ServiceApp.java:51)

Oct 23, 2016 12:40:22 PM cc.search.suggestion.SuggestionHandler loadDatabases
SEVERE: Failed to load the file name suggestion database!
java.io.EOFException
at org.apache.lucene.store.InputStreamDataInput.readByte(InputStreamDataInput.java:37)
at org.apache.lucene.store.DataInput.readInt(DataInput.java:96)
at org.apache.lucene.codecs.CodecUtil.checkHeader(CodecUtil.java:134)
at org.apache.lucene.util.fst.FST.(FST.java:322)
at org.apache.lucene.util.fst.FST.(FST.java:308)
at org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester.load(AnalyzingSuggester.java:593)
at cc.search.suggestion.SuggestionHandler.loadFileNameSuggester(SuggestionHandler.java:120)
at cc.search.suggestion.SuggestionHandler.loadDatabases(SuggestionHandler.java:47)
at cc.search.service.app.service.SearchHandler.(SearchHandler.java:158)
at cc.search.service.app.service.ServiceApp.(ServiceApp.java:30)
at cc.search.service.app.service.ServiceApp.main(ServiceApp.java:51)

Oct 23, 2016 12:40:22 PM cc.search.service.app.service.ServiceApp main
INFO: Start serving search for index /home/jonh/cc/workdir/simple_project/data/search
Oct 23, 2016 12:40:22 PM cc.search.service.app.service.ServiceApp main
INFO: Start serving search for index /home/jonh/cc/workdir/tinyxml/data/search

Enum as return types

For most types codecompass shows what functions return this type. It does not work for enums.

Delete workspace while server is running

While CodeCompass server is running, the used databases can't be removed. We should give a user friendly warning message that the delete command emitted by the CLI was rejected and we should make sure that in this case the other parts of the workspace (i.e. the content of workspace.cfg and the project directory) is untouched.

Definition search order

When I am looking for a class, it is annoying to list all the forward declarations. Of course, I can always use go to definition, but I think it is a redundant action. We either should not show forward declarations or list them after the real definitions.

Component Users diagram

Component Users diagram for source file S shows which source files depend on S through the interfaces S provides.

"Graph generation seems to be too long."

If I use "Non Reduced View" to see "Component Users" of a main.cpp file for a big project I get the following error right away:

"Graph generation seems to be too long."

Still I can see a loading animation but I wander maybe I should get this error after a while not right away.

Also I wonder if I should wait more for the drawing to appear (in this case) or it will never appear? (I've waited like 10 minutes)

update: I will try "Non Reduced View" option with a simpler project, I was just curios what is displayed for a bigger project.

CodeCompass is incompatible with thrift 0.9.3

Thrift 0.9.3 introduced a change:

[THRIFT-727] - support native C++ language specific exception message

This change generates a what() method for all generated exception classes. CodeCompass
has a what field in most exception classes leading to conflicting definitions in generated files.

At least one CodeCompass thrift file seems to have become invalid in thrift 0.9.3:

[ERROR:CodeCompass/service/version-api/version.thrift:368] (last token was 'from')
Cannot use reserved language keyword: "from"

Internal Architecture of a module

This diagram shows the relationships between the subdirectories of the queried module. This diagram is useful to understand the relationships of the subdirectories (submodules) of a module.

Set CODECHECKER_HOME environment variable!

Hi.
When I try to use the following line:

CodeCompass codechecker -w /home/john/cc/workdir/ -n src_test_project --dbport 6250 --dbuser john

I am getting this error:

Set CODECHECKER_HOME environment variable!

even if that variable is set:

$ env | grep -i codechecker
CODECHECKER_HOME=/home/john/cc/CodeCompass/service/codechecker

I've also tried:

python /home/john/cc/CodeCompass-install/share/codecompass/cli/CodeCompass.py codechecker -w /home/john/cc/workdir/ -n src_test_project --dbport 6250 --dbuser john

Any idea what to do?

Browsing History

Browsing History shows the path of the source code's iteration in a tree structure. When a file is opened via File Manager, Info Tree or Query Results then a new tree node is added under the root.

Infobox

Create an infobox feature which shows the documentation of the clicked AST node.

Copy the file after `-l` with name build.json

The file given after –l flag in wrapper script should be copied as build.json to the project directory. This is necessary because CodeCompass codechecker ... command uses this file too.

libindexerservice.so installation directory

libindexerservice.so is installed directly under lib directory. This file is used for parsing for sure. If it is not used for service then this file should go under parserplugin directory.

File manager jump to source feature

We can create shortcuts(labels) to some parts of the project, such as to the root of the directory containing the source code of the project and after we can jump to that parts easily.

Skipping a dependent parser

What happens if user provides a --skip action for a parser which is the dependency of an other? We should warn the user about this in a log message.

Depends On Diagram

The "depends on" diagram on module A traverses the subdirectories of module A and shows all directories that contain files that any of the source files in A includes.

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.