如何讀取程式碼數,讀取程式碼數

來源:互聯網
上載者:User

如何讀取程式碼數,讀取程式碼數

使用 CLOC (Count Line of Code)


前提條件:1. 預裝有perl

                  2. 下載CLOC. http://cloc.sourceforge.net/

解壓安裝包,得到cloc-version.pl

開啟命令列,定位到解壓檔案的檔案夾,然後敲入命令

perl cloc-version.pl YourProject.tar.gz

輸出例子:

     594 text files.     126 unique files.                                                14 files ignored.http://cloc.sourceforge.net v 1.62  T=14.82 s (7.6 files/s, 925.6 lines/s)-------------------------------------------------------------------------------Language                     files          blank        comment           code-------------------------------------------------------------------------------Swift                           67           2780           1119           6843Objective C                      7            265            192           1308JSON                            27              0              0            697HTML                             1             11              0            233C/C++ Header                    10             53             96            125-------------------------------------------------------------------------------SUM:                           112           3109           1407           9206-------------------------------------------------------------------------------

CLOC支援的檔案格式:

ABAP                       (abap)ActionScript               (as)Ada                        (ada, adb, ads, pad)ADSO/IDSM                  (adso)AMPLE                      (ample, dofile, startup)Ant                        (build.xml)Apex Trigger               (trigger)Arduino Sketch             (ino, pde)ASP                        (asa, asp)ASP.Net                    (asax, ascx, asmx, aspx, config, master, sitemap, webinfo)Assembly                   (asm, S, s)AutoHotkey                 (ahk)awk                        (awk)Bourne Again Shell         (bash)Bourne Shell               (sh)C                          (c, ec, pgc)C Shell                    (csh, tcsh)C#                         (cs)C++                        (C, c++, cc, cpp, cxx, pcc)C/C++ Header               (H, h, hh, hpp)CCS                        (ccs)Clojure                    (clj)ClojureScript              (cljs)CMake                      (cmake, CMakeLists.txt)COBOL                      (CBL, cbl, cob, COB)CoffeeScript               (coffee)ColdFusion                 (cfm)ColdFusion CFScript        (cfc)CSS                        (css)CUDA                       (cu)Cython                     (pyx)D                          (d)DAL                        (da)Dart                       (dart)DOS Batch                  (bat, BAT, btm, BTM, cmd, CMD)DTD                        (dtd)ECPP                       (ecpp)Erlang                     (erl, hrl)Expect                     (exp)F#                         (fs, fsi)Focus                      (focexec)Fortran 77                 (F, f, F77, f77, pfo)Fortran 90                 (F90, f90)Fortran 95                 (F95, f95)Go                         (go)Grails                     (gsp)Groovy                     (gant, groovy)Haml                       (haml)Handlebars                 (handlebars, hbs)Harbour                    (hb)Haskell                    (hs, lhs)HLSL                       (cg, cginc, shader)HTML                       (htm, html)IDL                        (idl, pro)InstallShield              (ism)Java                       (java)Javascript                 (js)JavaServer Faces           (jsf, xhtml)JCL                        (jcl)JSON                       (json)JSP                        (jsp, jspf)Kermit                     (ksc)Korn Shell                 (ksh)Kotlin                     (kt)LESS                       (less)lex                        (l)Lisp                       (el, jl, lisp, lsp, sc)Lisp/OpenCL                (cl)LiveLink OScript           (oscript)Lua                        (lua)m4                         (ac, m4)make                       (am, gnumakefile, Gnumakefile, Makefile, makefile)MATLAB                     (m)Maven                      (pom, pom.xml)Modula3                    (i3, ig, m3, mg)MSBuild script             (csproj, vbproj, vcproj, wdproj, wixproj)MUMPS                      (mps, m)Mustache                   (mustache)MXML                       (mxml)NAnt script                (build)NASTRAN DMAP               (dmap)Objective C                (m)Objective C++              (mm)OCaml                      (ml, mli, mll, mly)Oracle Forms               (fmt)Oracle Reports             (rex)Pascal                     (dpr, p, pas)Pascal/Puppet              (pp)Patran Command Language    (pcl, ses)Perl                       (perl, PL, pl, plh, plx, pm)PHP                        (php, php3, php4, php5)PHP/Pascal                 (inc)Pig Latin                  (pig)PL/I                       (pl1)PowerShell                 (ps1)Python                     (py)QML                        (qml)R                          (R)Racket                     (rkt, rktl, sch, scm, scrbl, ss)Razor                      (cshtml)Rexx                       (rexx)RobotFramework             (tsv)Ruby                       (rake, rb)Ruby HTML                  (rhtml)Rust                       (rs)SASS                       (sass, scss)Scala                      (scala)sed                        (sed)SKILL                      (il)SKILL++                    (ils)Smarty                     (smarty, tpl)Softbridge Basic           (sbl, SBL)SQL                        (psql, sql, SQL)SQL Data                   (data.sql)SQL Stored Procedure       (spc.sql, spoc.sql, sproc.sql, udf.sql)Swift                      (swift)Tcl/Tk                     (itk, tcl, tk)Teamcenter met             (met)Teamcenter mth             (mth)TypeScript                 (ts)Unity-Prefab               (mat, prefab)Vala                       (vala)Vala Header                (vapi)Velocity Template Language (vm)Verilog-SystemVerilog      (sv, svh, v)VHDL                       (vhd, VHD, VHDL, vhdl)vim script                 (vim)Visual Basic               (bas, cls, ctl, dsr, frm, vb, VB, vba, VBA, vbs, VBS)Visualforce Component      (component)Visualforce Page           (page)Windows Message File       (mc)Windows Module Definition  (def)Windows Resource File      (rc, rc2)WiX include                (wxi)WiX source                 (wxs)WiX string localization    (wxl)XAML                       (xaml)xBase                      (prg)xBase Header               (ch)XML                        (XML, xml)XQuery                     (xq, xquery)XSD                        (xsd, XSD)XSLT                       (xsl, XSL, xslt, XSLT)yacc                       (y)YAML                       (yaml, yml)


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.