Identify LOC for each file in iOS project - ObjectiveC based application development - objective-c

Is there tool that will give me a detailed report on number lines each file/class in project has?
I tried CLOC. All that I get is that the project level and that is nice to start with. I want a detailed drill down on each class. Do we have any open source tools that will do this for me?

I recommend using sloccount, you will get the LOC by directories and files as expected. You won't be able to have the LOC by class however.
If this limitation is ok, just use the --details flag in the command line you are using, for example if you run the sloccount command in the root directory of your Xcode project::
sloccount --duplicates --wide --details YOUR-TARGET-NAME
The output is a bit hard to read but you will get all the information you need.
If you want to have a nice report and be able to drill down in the directories/files via a HTML report, I suggest using Jenkins. Just install the 'Jenkins plugin for sloccount' via Jenkins UI.
You can see how to setup it in this blog article (disclaimer: I am the author). You will also be able to see examples of such reports.

I use Xcode Assistant...
Download here...

i was looking for a good open source metrics counter for Objective C for a long time... i didn't find any yet...
you can use ProjectCodeMeter http://projectcodemeter.com, but it's not free... hovever the trial version works for 3 months and when it ran out i installed it on my laptop and got another 3 months :)

I only find Xcode Statistician at http://www.literatureandlatte.com/freestuff/index.html

Related

NIST Round 3 Classic McEliece Missing Libkeccek.a.headers/SimpleFIPS202.h

I am attempting to build the KAT's for the round 3 submission for Classic McEliece, based off the reference implementation on this site:
https://csrc.nist.gov/Projects/post-quantum-cryptography/post-quantum-cryptography-standardization/round-3-submissions
When I try and build it, I get the error:
libkeccak.a.headers/SimpleFIPS202.h
I have attempted to build XKCP by cloning this repo: https://github.com/XKCP/XKCP
and running: make generic64/libXKCP.a
I can see that this builds, and I get a directory within the repo ./bin/generic64/libXKCP.a.headers
Has the name of this project changed since the round 3 submissions were released, or should I be looking for a different repository?
If this is correct, I still cannot build Classic McEliece, even if I change all references from libkeccak.a.headers/SimpleFIPS202.h to libXKCP.a.headers/SimpleFIPS202.h
Do I need to move this directory: ./bin/generic64/libXKCP.a.headers somewhere to allow gcc to find it? (I am on wsl)
Managed to fix it myself.
This question helped me: C++ Using Keccak Library
I had to clone those repos to the correct spot.
Then you need to change the include from libkeccak.a.headers/SimpleFIPS202.h to libXKCP.a.headers/SimpleFIPS202.h , as I guessed.
After that, you also need to change one of the flags in compilation from -lkeccak to -lXKCP (I couldnt find a reference anywhere, so this was a guess, but it worked.)

Getting EduTool to work for Kotlin in Intellij

I am trying to learn Kotlin by following the tutorial. I managed to get the plugin installed in Intellij. But I am not able to get the first exercise to run. When I click on the little checkbok it tells me
Failed to launch checking. See idea.log for more details.
(I created another blank project and type the same simple exercise in a scratch file and it works.)
link to docs
Try to check the project's is linked to the right JDK. Open File/Project Structure/Project. Then select the correct Project SDK.
To me, this helped. But as others have pointed out, please, share your idea.log, which you can find at Help/Show log in [whatever text editor it's associated with].

running grails unit tests in vim

Im trying to find a way to run my grails unit/integration tests in vim without having to leave my editor. Is there a good plugin for that? I took a lot of tips from here http://www.objectpartners.com/2012/02/21/using-vim-as-your-grails-ide-part-1-navigating-your-project/ but I dont want to have to switch to just see the output.
I tried it with a keymap but grails has to start up each time. Any ideas? How do you guys do this?
I also found this https://github.com/hoffoo/vim-grails-console but couldn't get it set up properly.
Thanks!
I've started to use Tim Pope's vim-dispatch plugin to execute tests in a shell and then report the results back to vim. You can see my version of executing a grails test in my dotfiles repo, specifically, in grailsScripts
In order for the plugin to report back to vim, you need to set an errorformat. I've battled with vim's errorformat for quite awhile and ultimately landed on using a combination of reformatting the output with a groovy script and using errorformat to highlight file paths. The result is that you see the entire grails output in the error list, but can hit enter on lines with file paths and go to the line in question. It's not perfect, but it works.
If you are interested in using that method, you'll want to also get the following files from my dotfiles:
.vim/tools/filters.groovy
.vim/compiler/grails.vim
Note that these scripts work in my setup, but I haven't made them into a plugin yet, so your mileage may vary. I hope it helps!

Getting Cocoa method completions in Sublime Text 2

I've been playing with Sublime Text 2 the last few days and was wondering if anyone out there has had any success getting Cocoa method completions working yet? Is there a plugin (or in-progress project to create one) out there?
Any general comments on using Objective-C in Chocolat or Sublime Text 2 would also be welcome.
There is an in-progress Sublime Text package that connects to clang to get autocomplete data called SublimeClang I've not managed to successfully get it to work totally with Cocoa/UIKit Dev, but here's a screenshot
and my options, that are a start
In MacVim I use a plugin called Cocoa.vim which haves useful python scripts that generates a classes and methods files for autocompletion. I didn't try so much with ST2, but may be is posible to create a sublime-package or sublime-completions file with all this data.
For the moment, I only create a sublime-completions file with some snippets. If I find a way to make this work, I will tell you.
I let my SublimeClang configuration options if helps anybody. I've already some of the autocompletions working:
"options":[
"-Wall",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/c++/4.2.1/",
"-I/usr/lib/clang/3.1/include/**",
"-I", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/",
"-arch","armv7",
"-isysroot", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk",
"-D__IPHONE_OS_VERSION_MIN_REQUIRED=50000",
"-ferror-limit=0"
]
Answering my own question here. A quick visit to the Sublime forums didn't turn up any leads nor did Google. It looks as though method completions for Objective-C aren't currently part of the default install nor available via 3rd-party quite yet.
This user http://b.rthr.me/wp/?p=368 claims to have gotten SublimeClang working. I may report back myself once I try it...

Is there a script that turns a Pharo core image into something more useful, that would include an OmniBrowser?

I cannot use the most recent dev Pharo release because of some strange issues with the compiler built into Pharo. Well. I was wondering if there is a quick way to install all the nifty extras into Pharo that the core image misses, as compared to the dev image.
With all non-core Pharo images come a script which was used to build that image. Just edit that file and drag&drop it on a new core.
You could also tell me what you don't like in the Pharo images so that I can enhance them.
There is also the script I published on the Pharo wiki that I use to build my images:
http://code.google.com/p/pharo/wiki/ImageBuildScripts
Of course it is very specific to my preferences and needs, but you can take it as an example and adapt it to your own needs.
CommandShell works with Pharo 9.10.10. You will hit several errors as you try to load the package due to Pharo lacking MVC, but you can simply proceed past the first bunch and abandon the last one (that tries to actually open a CommandShell in Morphic). At that point, you'll have a class called PipeableOSProcess that can be used very easily to grab output. For example:
(PipeableOSProcess command: 'ls /bin') output
will return the contents of your bin directory as a string.
Ok, OB itself can be easily downloaded using ScriptLoader loadSuperOB.
Damien adds (from comment below):
The problem with that approach is that nobody really maintains it.
Moreover, you miss some configuration steps to enhance the use of OB
(for example, you won't have the OB-based browsers if you ask for the
senders of a message from a workspace)