Coder Social home page Coder Social logo

exakat / exakat Goto Github PK

View Code? Open in Web Editor NEW
376.0 17.0 43.0 139.48 MB

The Exakat Engine : smart static analysis for PHP

Home Page: http://www.exakat.io/

License: Other

PHP 96.69% HTML 1.11% CSS 0.37% JavaScript 1.42% Shell 0.40% Hack 0.01%
php php7 gremlin neo4j phar exakat-engine review-tools analysis analysis-framework static-analysis

exakat's Introduction

Exakat

The Exakat Engine is an automated code reviewing engine for PHP.

Moved to exakat-ce

This repository has been moved to a new home, see https://github.com/exakat/exakat-ce

exakat's People

Contributors

alcalyn avatar christopheexakat avatar dseguy avatar exakat avatar freezy-sk avatar grummfy avatar htersteeg avatar pierozi avatar seldaek avatar skoop 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

exakat's Issues

Error : No such loader as "Tinkergraph". Use one of SplitGraphson

Hi,

When I try to scan initialised project, I have this error:
Error : No such loader as "Tinkergraph". Use one of SplitGraphson

on file phar:////exakat/exakat.phar/library/Exakat/Tasks/Load.php
on line 449

When checking the file I found that the loaderList array only contains SplitGraphson:
private $loaderList = array('SplitGraphson');
//'CypherG3', 'Neo4jImport', 'Janusgraph', 'Tinkergraph', 'GSNeo4j', 'JanusCaES', 'Tcsv',

Is this on purpose ?

How can I get this SplitGraphson ?

Thank you !

exacat v 0.10.8 running error on ubuntu

php exakat.phar doctor
exakat :
executable : exakat.phar
version : 0.10.8
build : 571
exakat.ini : /home/rikvd4/exakat/config/exakat.ini
reports : Ambassador,
PhpConfiguration,
PhpCompilation,
RadwellCode,
ZendFramework
themes : CompatibilityPHP70,
CompatibilityPHP71,
CompatibilityPHP72,
Analyze,
Preferences,
Appinfo,
Appcontent,
"Dead code",
Security,
Custom

PHP :
binary : 7.1.4-1+deb.sury.org~xenial+1
ext/curl : Yes
ext/hash : Yes
ext/phar : Yes
ext/sqlite3 : Yes
ext/tokenizer : Yes
ext/mbstring : Yes
ext/json : Yes

java :
installed : Yes
type : Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
version : java
$JAVA_HOME :

neo4j :
version : Neo4j 2.3.9
MaxPermSize : 512m
port : 7474
authentication : Not enabled
gremlinPlugin : Configured.
gremlinJar : neo4j-gremlin-3.2.0-incubating.jar
scriptFolder : Yes
pid : 1799
running : No
$NEO4J_HOME :
$NEO4J_HOME / config : Different

folders :
config-folder : Yes
config.ini : Yes
projects folder : Yes
projects/test : No
projects/default : No
projects/onepage : No

PHP 5.2 :
configured : No

PHP 5.3 :
configured : No

PHP 5.4 :
configured : No

PHP 5.5 :
configured : No

PHP 5.6 :
configured : No

PHP 7.0 :
configured : No

PHP 7.1 :
configured : Yes (/usr/bin/php)
version : 7.1.4-1+deb.sury.org~xenial+1
short_open_tags : Off
timezone :
tokenizer : Yes
memory_limit : -1

PHP 7.2 :
configured : No


Error running

Error : Error during Gremlin query : 'org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script6.groovy: 1: unexpected token: a @ line 1, column 5.
def a-407714139() {
^

1 error
'.
Query : a-407714139 = a-407714139();
g.V().hasLabel("Identifier")
.where( __.in("DEFINITION", "NEW", "USE", "NAME", "EXTENDS", "IMPLEMENTS", "CLASS", "CONST", "CONSTANT", "TYPEHINT", "FUNCTION", "GROUPUSE", "SUBNAME", "PROPERTY").count().is(eq(0)) )
.filter{ it.get().value("code").toLowerCase() in a-407714139 }
.sideEffect{
fullnspath = "\" + it.get().value("code").toLowerCase();
it.get().property("fullnspath", fullnspath);
}

on file phar:///home/rikvd4/exakat/exakat.phar/library/Exakat/Graph/Gremlin3.php
on line 210

Detect all paths in exakat

Hello
I research about static code analyzers. I want to understand, how to work them. Specially, Parse after analysis and detect patch in php code. I know, php parser not be able to recognize include, require and etc expression. I want to know, how dose your program recognize path? Or is it need?
Did you use any library or tools? or did you develop this part in your app?
How dose exakat detect all paths in php code?
How about other tools?
Dose it need special libraries?

Thank you.

Analysing large files results in memory overflow

Hi!

I am using Exakat to analyse a large application with files going well over 8.000 lines. When I use normal settings for PHP (normal being memory_limit set to anything expect infinite) it results in an error when decoding the json from the curl result (https://github.com/exakat/exakat/blob/master/library/Exakat/Graph/Gremlin3.php#L196). A proposed solution would be using a library to read the result as a stream.
Something like https://github.com/salsify/jsonstreamingparser could be used.

What do you think of this solution?

Regards,

Edwin

The best way to speed up the process

I see that everytime I run project command the sqlite databases are removed.

I think that they need only to be updated to avoid a check of every file also for ignoredfiles and files table.
So maybe a command only to update the db and one to run the analyzers.

tag release versions

Last tagged and pushed git tag for this repository was 0.6.1 albeit master and the official website mentions 0.8.9.

Please tag those commits which their version number. We use docker to build an image to use exakat in-house and it will save some manual tracking of the repository if we can base our build on those tags.

Doctor not working properly

Hello,

I got the following situation:

agora@testing:~/exakat$ php exakat.phar doctor
agora@testing:~/exakat$ php exakat.phar init -p sculpin -R https://github.com/sculpin/sculpin

Error : The PHP version cannot be used to run Exakat : PHP needs the curl extension
 
on file phar:///home/agora/exakat/exakat.phar/library/Exakat/Config.php
on line 150

I guess this should not be expected behavior.

Cheers,

PHP binary for version 7.2 doesn't have the right middle version : "7.1.9" is provided

Done
Array
(
[notCompilable52] => N/C
[notCompilable53] => N/C
[notCompilable54] => N/C
[notCompilable55] => N/C
[notCompilable56] => N/C
[notCompilable70] => N/C
[notCompilable71] => 3
[notCompilable72] => N/C
[notCompilable73] => N/C
[php] => 456
)

Error : PHP binary for version 7.2 doesn't have the right middle version : "7.1.9" is provided. Please, check config/exakat.ini
on file phar:///Users/jun/Desktop/Tools/exakat/exakat.phar/library/Exakat/Phpexec.php
on line 216

please..thx

No reports after execution using code from your documentation

Hi,

I installed exakat on ubuntu 16.04. This is report from exakat doctor: https://pastebin.com/FR7MVBfY The first issue which I had was that this command:
php exakat.phar init -p sculpin -R https://github.com/sculpin/sculpin
didn't clome given repository, so entered code dir and put git clone in terminal. After that I run:
php exakat.phar project -p sculpin
And there was few progress bar and script ended without error, but there is no dir like: projects/sculpin/report. Why report didn't generate?

Best regards,
KS

Are there rules for high risk functions???

High risk functions, such as phpinfo,eval,chroot,scandir,chgrp,chown,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,fsocket,fsockopen.

Resolution of path to PHP runtime assumes PHP is the originating process

If you make a fresh install of exakat and chmod +x exakat.phar, then use it with ./exakat.phar ... instead of php exakat.phar ... , it assumes that the starting process is the current PHP runtime, and this results in an incorrect (and persistent) value in the config.ini file, in my case:

php72 = /Users/marcus/Sites/exakat/./exakat.phar

which should have been:

php72 = /usr/local/bin/php

This results in errors like this:

/usr/local/bin/php exakat.phar project -p myproject
Error : This PHP version (
 ________                 __              _
|_   __  |               [  |  _         / |_
  | |_ \_| _   __  ,--.   | | / ]  ,--. `| |-'
  |  _| _ [ \ [  ]`'_\ :  | '' <  `'_\ : | |
 _| |__/ | > '  < // | |, | |`\ \ // | |,| |,
|________|[__]`\_]\'-;__/[__|  \_]\'-;__/\__/


Exakat : @ 2014-2017 Damien Seguy.
Version : 1.1.9 - Build 704 - Mon, 19 Mar 2018 21:10:35 +0000
) is not valid for running Exakat. You need PHP 7.0 or later.

on file phar:///Users/marcus/Sites/exakat/exakat.phar/library/Exakat/Tasks/Load.php
on line 255

You can see that it's using the exakat version output instead of PHP's version output.

Inside the phar file it uses /usr/bin/env php, which does point to the correct runtime.

Question: Error in run exakat.

Hello.
I install exakat with phar and with git in windows. After, i run exakat but saw a lot of error. For example, error php version, sqlite3 ... . After solve, run any commands that there are in your document.
errors are:

$ php exakat doctor
exakat :
    executable           : exakat
    version              : 0.11.0
    build                : 575
    exakat.ini           : C:\exakat/config/exakat.ini
    reports              : Ambassador,
                           PhpConfiguration,
                           PhpCompilation,
                           RadwellCode,
                           ZendFramework
    themes               : CompatibilityPHP70,
                           CompatibilityPHP71,
                           CompatibilityPHP72,
                           Analyze,
                           Preferences,
                           Appinfo,
                           Appcontent,
                           "Dead code",
                           Security,
                           Custom

PHP :
    binary               : 7.0.6
    ext/curl             : Yes
    ext/hash             : Yes
    ext/phar             : Yes
    ext/sqlite3          : Yes
    ext/tokenizer        : Yes
    ext/mbstring         : Yes
    ext/json             : Yes

java :
    installed            : Yes
    type                 : Java(TM) SE Runtime Environment (build 1.8.0_102-b14)

    version              : java
    $JAVA_HOME           :

neo4j :
    installed            : Couldn't find the path to neo4j from the config/exaka
t.ini. Please, check it.

folders :
    config-folder        : Yes
    config.ini           : Yes
    projects folder      : Yes
    projects/test        : Yes
    projects/default     : No
    projects/onepage     : No

PHP 5.2 :
    configured           : No

PHP 5.3 :
    configured           : No

PHP 5.4 :
    configured           : No

PHP 5.5 :
    configured           : No

PHP 5.6 :
    configured           : No

PHP 7.0 :
    configured           : No

PHP 7.1 :
    configured           : No

PHP 7.2 :
    configured           : No

How can i correct them?
and dose exakat detect security vulnerability? (sqli, xss ...)

Thank you.

Docker - Error : Unable to open database: unable to open database file

Tried to run a project from the newest docker image and got an error:

[root@localhost ~]# docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat version

 ________                 __              _
|_   __  |               [  |  _         / |_
  | |_ \_| _   __  ,--.   | | / ]  ,--. `| |-'
  |  _| _ [ \ [  ]`'_\ :  | '' <  `'_\ : | |
 _| |__/ | > '  < // | |, | |`\ \ // | |,| |,
|________|[__]`\_]\'-;__/[__|  \_]\'-;__/\__/


Exakat : @ 2014-2018 Damien Seguy.
Version : 1.3.0 - Build 753 - Mon, 04 Jun 2018 09:05:29 +0000
[root@localhost ~]# docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
docker.io/exakat/exakat   latest              6502d9c124c9        27 hours ago        1.34 GB
[root@localhost ~]#  docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat project -p <my_project>

Error : Unable to open database: unable to open database file
on file phar:///usr/src/exakat/exakat.phar/library/Exakat/Datastore.php
on line 58

[root@localhost ~]# docker --version
Docker version 1.13.1, build 94f4240/1.13.1
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

Installation Instruction Out of Date

The installation instruction at : https://exakat.readthedocs.io/en/latest/Installation.html#requirements
specifically the ubuntu ones : https://exakat.readthedocs.io/en/latest/Installation.html#quick-installation-with-debian-ubuntu
suggest running wget -O apache-tinkerpop-gremlin-server-3.2.6-bin.zip http://ftp.tudelft.nl/apache/tinkerpop/3.2.6/apache-tinkerpop-gremlin-server-3.2.6-bin.zip
except that fails, becasuse the file apache-tinkerpop-gremlin-server-3.2.6-bin.zip, nolonger exists on the server.
It appears it has been replaced by version 3.27.
The documentation needs to updated to reflect this version change

"preg_replace with option e" does not match properly

Analyzer/Structures/pregOptionE.php matches in out project for the following two expressions, even if that should not be the case:

$txt = preg_replace("/<head>.+?<\\/head>/si", '', $txt);
$txt = preg_replace("/<style[^>]?>.+?<\\/style>/si", '', $txt);

The following line does not trigger, even if I do not see much of a difference:
$txt = preg_replace("/<script[^>]?>.+?<\\/script>/si", '', $txt);

Error during Gremlin query

Hello
After run exakat for some code, for example phpmyadmin, some times we get error for gremlin.

Error : Error during Gremlin query : 'Failure to begin transaction'.
Query : g.V().count();
 
on file /exakat/exakat.phar/library/Exakat/Graph/Gremlin3.php
on line 201

How can i fix them?

cannot create db/gsneo4j.pid

Is this normal:

$ php exakat.phar project -p sculpin -v
Cleaning project
Cleaning project sculpin
removing log
removing datastore.sqlite
Removed 1 files
Recreating database
Search for external libraries
Processing files
No files to process. Aborting
Running project 'sculpin'
Running the following analysis : CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72, CompatibilityPHP73, Analyze, Preferences, Inventory, Performances, Appinfo, Appcontent, Dead code, Security, Custom
Producing the following reports : Ambassador
Cleaning DB
sh: 1: cannot create db/gsneo4j.pid: Directory nonexistent

Then it takes a long time ( I waited about 10 min), but I see no progress nor any more messages.

Error: gremlin-php driver : Connection refused

Hello,
when I run Exakat, I receive the next error:

Error : gremlin-php driver has thrown the following error : Connection refused 
on file phar:///usr/src/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Connection.php
on line 845

I receive this error also when I use docker container

Verbose log

Cleaning project
Cleaning project nlptools
removing log
removing datastore.sqlite
Removed 1 files
Recreating database
Search for external libraries
Processing files
No files to process. Aborting
Running project 'nlptools'
Running the following analysis : CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72, Analyze, Preferences, Appinfo, Appcontent, "Dead code", Security, Custom, CompatibilityPHP73, Inventory, Performances, Dead code, Suggestions
Producing the following reports : Ambassador
Cleaning DB
start gremlin server 3.3.x
started gremlin server
Restarted in 20 rounds
started [32] in 21,031.85 ms
Running files
Check composer
Searching for files
Found the files
Check compilation for 71
Check short tag (normal pass)
Check short tag (with directive activated)
Short tag OK
Check config files
+ .git
Done
Array
(
    [notCompilable52] => N/C
    [notCompilable53] => N/C
    [notCompilable54] => N/C
    [notCompilable55] => N/C
    [notCompilable56] => N/C
    [notCompilable70] => N/C
    [notCompilable71] => 0
    [notCompilable72] => N/C
    [notCompilable73] => N/C
    [php] => 20
)
Loading with SplitGraphson

Error : gremlin-php driver has thrown the following error : Connection refused 
on file phar:///usr/src/exakat/exakat.phar/vendor/brightzone/gremlin-php/src/Connection.php
on line 845

Does it work with Java 1.8?

I didn't see any Java requirements going through the installation instructions, so this is not expected:

[11:13:12] [...webservices/exakat (develop)] php exakat.phar init -p pbe -R 'http://[email protected]/scm/ws/webservices.git'
[11:20:17] [...webservices/exakat (develop)] php exakat.phar project -p pbe
Unable to find any JVMs matching version "1.7".
[11:33:02] [...webservices/exakat (develop)] which java
/usr/bin/java
[11:34:33] [...webservices/exakat (develop)] java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

This is on macOS 10.12.

Am I missing something? Is this a real issue?
Thanks,

ext-sqlite dependency

I've been grepping exakat's source to see where exactly sqlite is used to not much avail - there are hundreds of references but most of them seem to be in tests.

I'm trying to add exakat to projects without any db dependencies and where sqlite is not installed. Composer install fails as a result.

I'm aware of --ignore-platform-reqs. In this case it isn't an option.

Documentation broken Link

On the Readme page the documentation link is not reachable my github ( 404 ).
https://github.com/exakat/exakat/blob/master/docs/Installation.generic.md

Should not be https://exakat.readthedocs.io/en/latest/Installation.html ?

error on report codesniffer

Hello when I want to create the codesniffer report I got an error

Error : Format 'Codesniffer' doesn't exist. Choose among : Ambassador, Devoops, Text, Xml, Uml, PhpConfiguration, PhpCompilation, Inventories, Clustergrammer, FileDependencies, FileDependenciesHtml, ZendFramework, RadwellCode, Codesniffer, FacetedJson, Json, OnepageJson, Codacy
on file phar:///usr/src/exakat/exakat.phar/library/Exakat/Tasks/Report2.php
on line 49

Improve documentation of "Strpos comparison"

The report mentioned tons of "Strpos comparison"-issues, while only a small fraction was really issued by strpos calls. It would be good to improve the documentation such that it tells the user that this issue might also occur from other calls than strpos

In case executable not found write only the path

I put a wrong configuration for a php binary and I got this:

sh: 1: /usr/bin/php: not found

This is a bash error but is better to do a check and write something like the "PHP binary for x.x at path was not found.".
To simplify the debugging and have better error reports.

Exakat crashes without any errors

Followed the instructions to a T and ran:

php exakat.phar project -v -p sculpin-test

Exakat runs with the following output and then shuts down or crashes. Not sure how to debug from here.I think its probably because its a rather big PHP project and I have far too many files in the directory, but a failure/exception/stack trace would help.

Here's the output :

Cleaning project
Cleaning project sculpin-test
removing datastore.sqlite
Removed 1 files
Recreating database
Search for external libraries
Processing files
No files to process. Aborting
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
Running project 'sculpin-test'
Running the following analysis : CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72, CompatibilityPHP73, Analyze, Preferences, Inventory, Performances, Appinfo, Appcontent, Dead code, Security, Custom
Producing the following reports : Ambassador
Cleaning DB
stop gremlin server 3.2.x
started [29624] in 4,522.93 ms
Running files
Check composer
Searching for files
Found the files
Check compilation for 71
Check compilation for 56
Check short tag (normal pass)
Check short tag (with directive activated)
Short tag OK
Check config files
+ .DS_Store
Done
Array
(
    [notCompilable52] => N/C
    [notCompilable53] => N/C
    [notCompilable54] => N/C
    [notCompilable55] => N/C
    [notCompilable56] => 0
    [notCompilable70] => N/C
    [notCompilable71] => 1
    [notCompilable72] => N/C
    [notCompilable73] => N/C
    [php] => 780
)
Loading with SplitGraphson

It crashes and returns to command prompt after SplitGraphson above.

Composer deps: requires guiguiboy/php-cli-progress-bar

I'm trying to install exakat as a dev dependency through composer and it's currently failing as it requires guiguiboy/php-cli-progress-bar:dev-master. This conflicts with my minimum-stability (stable) config.

php-cli-progress-bar does have a 1.0 release, perhaps should require that instead? Or ditch in favour of something else as the project is abandoned and could become troublesome as PHP evolves and continues its deprecations.

Sombrero!

Please consider renaming the datas directory to data.
Thank you. ๐ŸŒต ๐Ÿด ๐Ÿ‘ข

Get error "No such property: graph for class: Script3"

I installed exakat on Ubuntu 16.04 by using the documentation on exakat.readthedocs.io and get the following error message:

php exakat.phar project -p sculpin

Error : The script submitted for processing evaluated in the ScriptEngine with errors and could not be processed. Check the script submitted for syntax errors or other problems and then resubmit. : No such property: graph for class: Script3

=================== SERVER TRACE =========================
array (
'stackTrace' => 'groovy.lang.MissingPropertyException: No such property: graph for class: Script3
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:66)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:310)
at Script3.run(Script3.groovy:1)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:856)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:561)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
at org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines.eval(ScriptEngines.java:135)
at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:291)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
',
'exceptions' =>
array (
0 => 'groovy.lang.MissingPropertyException',
),
)

on file phar:///var/www/in.hoppl.staticanalysis/exakat.phar/vendor/brightzone/gremlin-php/src/Connection.php
on line 829

Object of class stdClass could not be converted to string error

Object of class stdClass could not be converted to string error.

Error in Exakat\Analyzer\Php\ClassFunctionConfusion 37 line.

Bug in Exakat\Analyzer\Analyzer 415 and 434 line.

$a = (array){new stdClass()} var_dump($a); array(1) { [0]=> object(stdClass)#235743 (2) { ["processed"]=> int(0) ["total"]=> int(0) } }

I change return array($result); to return json_decode(json_encode($result),true); is ok.

PHP used 7.1 (7.1.1)
Exakat version 0.10.2 ( Build 555)

How to understand that is excluding files?

I added different folders to ignore but in the log results as scanned.
There is a way to understand if the config is right? maybe is only scanning but ignoring them?

Error while building Ambassador in Ambassador.

Version : 1.3.3 - Build 775 - Tue, 26 Jun 2018 07:09:02 +0000
I'm using the default config, a fresh Docker image download

I ran exakat, and I got this:

...
Project loaded
Running the following themes : First
Initial dump
Ignoring the following unknown themes : "Dead code"
Running the following themes : Inventory, Analyze, Appinfo, Security, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56, Performances, Appcontent, Dead code, CompatibilityPHP53, Custom, CompatibilityPHP70, CompatibilityPHP71, CompatibilityPHP72, Preferences, CompatibilityPHP73, Suggestions
27/27 [===============================================================================================================================>] 100.00% 00:00:00
353/353 [=============================================================================================================================>] 100.00% 00:00:00
329/329 [=============================================================================================================================>] 100.00% 00:00:00
37/37 [===============================================================================================================================>] 100.00% 00:00:00
64/64 [===============================================================================================================================>] 100.00% 00:00:00
56/56 [===============================================================================================================================>] 100.00% 00:00:00
45/45 [===============================================================================================================================>] 100.00% 00:00:00
36/36 [===============================================================================================================================>] 100.00% 00:00:00
36/36 [===============================================================================================================================>] 100.00% 00:00:00
25/25 [===============================================================================================================================>] 100.00% 00:00:00
68/68 [===============================================================================================================================>] 100.00% 00:00:00
2/2 [=================================================================================================================================>] 100.00% 00:00:00
39/39 [===============================================================================================================================>] 100.00% 00:00:00
26/26 [===============================================================================================================================>] 100.00% 00:00:00
17/17 [===============================================================================================================================>] 100.00% 00:00:00
25/25 [===============================================================================================================================>] 100.00% 00:00:00
3/3 [=================================================================================================================================>] 100.00% 00:00:00
56/56 [===============================================================================================================================>] 100.00% 00:00:00
Analyzed project
Reporting Ambassador
Error while building Ambassador in Ambassador.
Reported project
End

I don't find a generated report.
I ran it twice, both times the same error regarding "Ambassador".

'doctor' command complaining about incorrect php version

When I run the 'doctor' command, in the output for one of the installed PHP version it shows as:

PHP 5.6 :
    configured           : Yes (/usr/bin/php5.6)
    version              : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1 (This doesn't seem to be version 5.6)
    short_open_tags      : Off
    timezone             :
    tokenizer            : Yes
    memory_limit         : -1
    assertions           : -1

When I run the particular php version that it lists beside 'configured' it shows as the correct version:

/usr/bin/php5.6 --version
PHP 5.6.33-3+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

If I look into the php config file for the version (/usr/bin/etc/php-config5.6), it shows the correct version.

The default php version installed is php 7.2.2

# php --version
PHP 7.2.2-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb  6 2018 16:11:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.2-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

so I don't know why the incorrect version is showing as the version of php7.1 that I have installed on the same computer.

The full doctor command output, for debugging purposes:

# php exakat/exakat.phar doctor
exakat :
    executable           : exakat/exakat.phar
    version              : 1.1.3
    build                : 689
    exakat.ini           : /var/www/exakat/config/exakat.ini
    graphdb              : tinkergraph
    reports              : Ambassador
    themes               : CompatibilityPHP56,
                           CompatibilityPHP71,
                           Analyze,
                           Preferences,
                           Appinfo,
                           Appcontent,
                           Custom
    tokenslimit          : 1 000 000 000

PHP :
    binary               : 7.2.2-3+ubuntu16.04.1+deb.sury.org+1
    memory_limit         : -1
    ext/curl             : Yes
    ext/hash             : Yes
    ext/phar             : Yes
    ext/sqlite3          : Yes
    ext/tokenizer        : Yes
    ext/mbstring         : Yes
    ext/json             : Yes

java :
    installed            : Yes
    type                 : Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
    version              : java
    $JAVA_HOME           : /usr/lib/jvm/java-8-oracle
    $JAVA_OPTIONS        : -Xms1024m -Xmx6096m

tinkergraph :
    installed            : Yes (folder : /var/www/exakat/tinkergraph)
    host                 : 127.0.0.1
    port                 : 8182
    gremlin version      : 3.2.7

gsneo4j :
    installed            : Yes (folder : /var/www/exakat/tinkergraph)
    host                 : 127.0.0.1
    port                 : 7474
    gremlin version      : 3.2.7
    neo4j version        : 2.3.3

neo4j :
    installed            : Couldn't find the path to neo4j from the config/exakat.ini. Please, check it.

folders :
    projects folder      : Yes
    projects/test        : No
    projects/default     : No
    projects/onepage     : No

PHP 5.2 :
    configured           : No

PHP 5.3 :
    configured           : No

PHP 5.4 :
    configured           : No

PHP 5.5 :
    configured           : No

PHP 5.6 :
    configured           : Yes (/usr/bin/php5.6)
    version              : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1 (This doesn't seem to be version 5.6)
    short_open_tags      : Off
    timezone             :
    tokenizer            : Yes
    memory_limit         : -1
    assertions           : -1

PHP 7.0 :
    configured           : No

PHP 7.1 :
    configured           : Yes (/usr/bin/php7.1)
    version              : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1
    short_open_tags      : Off
    timezone             :
    tokenizer            : Yes
    memory_limit         : -1
    assertions           : -1

PHP 7.2 :
    configured           : Yes (/usr/bin/php7.2)
    version              : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1 (This doesn't seem to be version 7.2)
    short_open_tags      : Off
    timezone             :
    tokenizer            : Yes
    memory_limit         : -1
    assertions           : -1

PHP 7.3 :
    configured           : No

Increment code crash exakat

I got this error:

Error : Load task met an error : 'Warning : expression is not empty in /admin/includes/cmb2-extra.php : 1Array
(
    [0] => Exakat\Tasks\Helpers\Atom Object
        (
            [id] => 2541
            [atom] => Cast
            [code] => ++
            [lccode] => 
            [fullcode] => ++  
            [line] => 64
            [token] => T_INC
            [rank] => 
            [alternative] => 
            [reference] => 
            [heredoc] => 
            [delimiter] => 
            [noDelimiter] => 
            [variadic] => 
            [count] => 
            [fullnspath] => 
            [absolute] => 
            [alias] => 
            [origin] => 
            [encoding] => 
            [block] => 
            [intval] => 
            [strval] => 
            [boolean] => 
            [enclosing] => 
            [args_max] => 
            [args_min] => 
            [bracket] => 
            [flexible] => 
            [close_tag] => 
            [aliased] => 
            [propertyname] => 
            [constant] => 
            [root] => 
            [globalvar] => 
            [binaryString] => 
            [isNull] => 
            [visibility] => 
            [final] => 
            [abstract] => 
            [static] => 
            [ctype1] => ++V
            [ctype1_size] => 1
        )

)
'

The line with issues contain:

$i++;

Removing it fixed the problem.

tr: write error: Broken pipe

When exakat created a new project, tr command says "write error: Broken pipe",
Without -v option, exakat could not create a new project in vagrant-exakat.

./exakat.phar init -v -p PROJECT_NAME -R PRIVATE_REPOSITORY_URL
Initializing PROJECT_NAME with 'PRIVATE_REPOSITORY_URL'
Git initialization with PRIVATE_REPOSITORY_URL
Username for 'FOOBAR': USER_NAME
Password for 'FOOBAR':
Counting files
Running files
Check composer
Counting files
files    : 30
total    : 5672
tokens   : 11100
comments : 340
code     : 1974
Counted files
Check compilation for 55
Check compilation for 56
Check compilation for 70
Check compilation for 71
Check short tag (normal pass)
tr: write error: Broken pipe
Check short tag (with directive activated)
tr: write error: Broken pipe
Short tag OK
Check config files
Array
(
    [0] => Array
        (
            [file] => .htaccess
            [name] => Apache
            [homepage] => http://www.apache.org/
        )

    [1] => Array
        (
            [file] => .git
            [name] => git
            [homepage] => https://git-scm.com/
        )

)
Done
Array
(
    [notCompilable52] => N/C
    [notCompilable53] => N/C
    [notCompilable54] => N/C
    [notCompilable55] => 0
    [notCompilable56] => 0
    [notCompilable70] => 0
    [notCompilable71] => 0
    [php] => 30
)
Done

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.