cnescatlab / i-CodeCNES

i-Code CNES is a static code analysis tool to help developpers write code compliant with CNES coding rules.
Eclipse Public License 1.0
61 stars 16 forks source link

POSIX commands #132

Open Tom3592 opened 6 years ago

Tom3592 commented 6 years ago

Expected behavior

We would expect that the following commands are POSIX because they are very usefull and they allow a maintenable and readable code:

Actual behavior

These commands are not considered POSIX

Steps to reproduce behavior

no specific test case

Detection version

i-code 3.0

WaldoFR commented 6 years ago

Hi @ExemplesDev,

Thank you for reporting this issue.

Issue analysis

Indeed some of the commands you listed seems to be POSIX.

This is the case for :

However, i-Code CNES currently follow the RNC's rule statement which defined the following commands as POSIX ones :

Letter Command
A admin, alias, ar, asa, at, awk
B basename, batch, bc, bg
C c99, cal, cat, cd, cflow, chgrp, chmod, chown, cksum, cmp, comm, command, compress, cp, crontab, csplit, ctags, cut, cxref
D date, dd, delta, df, diff, dirname, du
E echo, ed, env, ex, expand, expr
F false, fc, fg, file, find, fold, fort77, fuser
G gencat, get, getconf, getopts, grep
HI hash, head, iconv, id, ipcrm, ipcs
JK jobs, join, kill
L lex, link, ln, locale, localedef, logger, logname, lp, ls
M m4, mailx, make, man, mesg, mkdir, mkfifo, more, mv
NO newgrp, nice, nl, nm, nohup, od
P paste, patch, pathchk, pax, pr, printf, prs, pr, pwd
Q qalter, qdel, qhold, qmove, qmsg, qrerun, qrls, qselect, qsig, qsub,
R read, renice, rm, rmdel, rmdir
S sact, sccs, sed, sh, sleep, sort, split, stat, strings, strip, stty
T tabs, tail, talk, tee, test, time, touch, tput, tr, true, tsort, tty, type
U ulimit, umask, unalias, uname, uncompress, unexpand, unget, uniq, unlink, uucp, uudecode, uuencode, uustat, uux
VW val, vi, wait, wc, what, who, write
XYZ xargs, yacc, zcat

Regards, WaldoFR

WaldoFR commented 6 years ago

Solution

To fix the problem, please push in the branch 3.1.0 dev the following modification :

Regards, WaldoFR

furmanc commented 6 years ago

After another analysis with i-code, the 2 following commands are also POSIX but there are not considered POSIX with i-code: