Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various minor issues in source code #8

Open
5 tasks
hosiet opened this issue Oct 26, 2016 · 0 comments
Open
5 tasks

Various minor issues in source code #8

hosiet opened this issue Oct 26, 2016 · 0 comments

Comments

@hosiet
Copy link
Contributor

hosiet commented Oct 26, 2016

Hello,

I picked up the fqterm package in Debian, you may find the package tracker here.

To improve the whole quality of the package, I ran the source checker program against fqterm v0.9.8.3.r4 today, namely check-all-the-things. There are vaious issues, I would select some and post them here. While some may be useful, other information may be considered pedantic. Feel free to select and fix them.

Problems includes

  • codespell check
  • common cpp code check
  • UTF-8 encoding check
  • Shell style check
  • desktop file check

codespell check

$ codespell --quiet-level=3
./INSTALL.txt:20: postion  ==> position
./INSTALL.txt:52: postion  ==> position
./VersionInfo:2: verison  ==> version
./VersionInfo:8: verison  ==> version
./res/dict/common_zh_CN.ts:563: ther  ==> there, their, the
./res/dict/ui_zh_CN.ts:163: Cant  ==> Can't
./res/script/system.py:26: artical  ==> article
./res/script/system.py:27: artical  ==> article
./res/script/download.py:136: formated  ==> formatted
./res/script/download.py:191: formated  ==> formatted

common cpp code check

$ cppcheck -j1 --quiet -f .
[src/common/fqterm_exif_extractor.cpp:378]: (error) Memory leak: buffer
[src/common/fqterm_sound.cpp:376]: (error) Shifting a negative value is undefined behaviour
[src/common/fqterm_sound.cpp:390]: (error) Uninitialized variable: outp
[src/ui/imageviewer.cpp:174]: (error) Array index -1 is out of bounds.

UTF-8 encoding check

./res/skin/dpstyle/ReadMe.txt: line 1, char 1, byte offset 4: invalid UTF-8 code
./src/fqterm/fqterm.rc: line 1, char 1, byte offset 1: invalid UTF-8 code

Shell style check

$ find -type f \( -iname '*.sh' -o -iname '*.bash' -o -iname '*.zsh' \) -exec shellcheck {} +

In ./res/fqterm.sh line 5:
current_directory=`/bin/pwd`
                  ^-- SC2006: Use $(..) instead of legacy `..`.


In ./res/fqterm.sh line 7:
cd `dirname "$this_name"`
^-- SC2164: Use cd ... || exit in case cd fails.
   ^-- SC2046: Quote this to prevent word splitting.

desktop file check

$ find -type f -iname '*.desktop' -exec desktop-file-validate {} \;
./res/fqterm.desktop: warning: key "Encoding" in group "Desktop Entry" is deprecated
./res/fqterm.desktop: warning: value "Application;Qt;Network;" for key "Categories" in group "Desktop Entry" contains a deprecated value "Application"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants