Explorar el Código

Added new files.

Marina Konstantinova hace 4 años
padre
commit
50348fe75a

+ 7 - 0
docs/docs/01-d-file.md

@@ -0,0 +1,7 @@
+---
+id: 01-d-file
+title: Overview
+sidebar_label: For developers
+---
+
+For developers

+ 1 - 1
docs/docs/01-overview.md

@@ -1,5 +1,5 @@
 ---
-id: 01-overview
+id: 01-m-overview
 title: Overview
 sidebar_label: Overview
 ---

+ 1 - 1
docs/docs/02-download_install.md

@@ -1,5 +1,5 @@
 ---
-id: 02-download-install
+id: 02-m-download-install
 title: Download and install
 sidebar_label: Download and install
 ---

+ 26 - 0
docs/docs/03-m-getting-started.md

@@ -0,0 +1,26 @@
+---
+id: 03-m-getting-started
+title: Getting started
+sidebar_label: Getting started
+---
+
+The tool is relatively simple to use. There are 3 fundamental steps:
+
+* Collect the data, for example:
+```
+> python "/path/to/metrix++.py" collect --std.code.lines.code --std.code.complexity.cyclomatic
+```
+
+
+* View the data, for example:
+```
+> python "/path/to/metrix++.py" view
+```
+
+
+* Apply thresholds, for example:
+```
+> python "/path/to/metrix++.py" limit --max-limit=std.code.complexity:cyclomatic:7
+```
+
+Please, check the advanced [description of the workflow](04-m-workflow.md) with real examples.

+ 0 - 5
docs/docs/03-metrics.md

@@ -1,5 +0,0 @@
----
-id: 03-metrics
-title: Metrics
-sidebar_label: Metrics
----

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 507 - 0
docs/docs/04-m-workflow.md


+ 77 - 0
docs/docs/05-m-extending-tool.md

@@ -0,0 +1,77 @@
+---
+id: 05-m-extending-tool
+title: Extending the tool
+sidebar_label: Extending the tool
+---
+
+Want to enable a new metric or a language, need advanced post-analysis tool? Please, check the plugin development tutorial.
+# Create plugin
+There are 3 types of plugins considered in this chapter:
+
+* Metric plugin
+* Language parser
+* Post-processing / Analysis tool
+
+Tutorial for metric plugin is generic at the beginning and large portion of this is applied to all other plugins. You need to know python and python regular expressions library to write Metrix++ extensions.
+
+## Metric plugin
+The tutorial will explain how to create a plugin to count magic numbers in source code. It will be relatively simple at first and will be extended with additional configuration options and smarter counting logic.
+
+### Create placeholder for new plugin
+1. All plugins are loaded by Metrix++ from standard places within the tool installation directory and from custom places specified in the METRIXPLUSPLUS_PATH environment variable. METRIXPLUSPLUS_PATH has got the same format as system PATH environment variable. So, the first step in plugin development is to set the METRIXPLUSPLUS_PATH to point out to the directory (or directories) where plugin is located.
+2. Create new python package 'myext', python lib 'magic.py' and 'magic.ini' file.
+```
++ working_directory (set in METRIXPLUSPLUS_PATH variable)
+\--+ myext
+   \--- __init__.py
+   \--- magic.py
+   \--- magic.ini
+```
+3. \__init\__.py is empty file to make myext considered by python as a package.
+
+4. Edit magic.py to have the following content:
+```cpp
+import mpp.api
+ 
+class Plugin(mpp.api.Plugin):
+    
+    def initialize(self):
+        print "Hello world"
+```
+mpp.api package include Metrix++ API classes. mpp.api.Plugin is the base class, which can be loaded by Metrix++ engine and does nothing by default. In the code sample above it is extended to print "Hello world" on initialization.
+
+5. Edit magic.ini to have the following content:
+```
+[Plugin]
+version: 1.0
+package: myext
+module:  magic
+class:   Plugin
+depends: None
+actions: collect
+enabled: True
+```
+
+This file is a manifest for Metrix++ plugin loader. The fields in Plugin section are:
+* **version** - 
+a string representing the version, step up it every time when behaviour of a plugin or backward compatibility in api or data scope is changed
+* **package** -
+python package name where to load from
+* **module** -
+python module name (filename of *.py file) to load
+* **class** -
+name of a plugin class to instanciate
+* **depends** -
+list of plugin names to load, if it this plugin is loaded
+* **actions** -
+list of Metrix++ actions affected by this plugin
+* **enabled** -
+True or False, working status of a plugin
+
+6. Now run Metrix++ to see how this new plugin works:
+```
+> python "/path/to/metrix++.py" collect
+```
+```
+Hello world
+```

+ 16 - 0
docs/docs/06-m-feeback-contribute.md

@@ -0,0 +1,16 @@
+---
+id: 06-m-feeback-contribute
+title: Feeback and contribute
+sidebar_label: Feeback and contribute
+---
+Now it is your turn. There are multiple ways how you can contribute and help to improve and progress Metrix++ project:
+
+* Try Metrix++ and [post review](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* [Submit new feature request or bug report](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* [Ask a question](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* Submit git pull request
+* Create and publish your plugin. [Request to refer](https://github.com/metrixplusplus/metrixplusplus/issues/new) to it from Metrix++ project space.
+* [Submit your plugin](https://github.com/metrixplusplus/metrixplusplus/issues/new) to include to the standard set
+* ... and consider to 
+<a href="mailto:avkonst@gmail.com?subject=Metrix%2B%2B Join Request" target="blank">join the project</a>
+!

+ 0 - 17
docs/docs/mdx.md

@@ -1,17 +0,0 @@
----
-id: mdx
-title: Powered by MDX
----
-
-You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
-
-export const Highlight = ({children, color}) => ( <span style={{
-      backgroundColor: color,
-      borderRadius: '2px',
-      color: '#fff',
-      padding: '0.2rem',
-    }}>{children}</span> );
-
-<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
-
-I can write **Markdown** alongside my _JSX_!

+ 2 - 2
docs/docusaurus.config.js

@@ -15,7 +15,7 @@ module.exports = {
       },
       links: [
         {
-          to: 'docs/01-overview',
+          to: 'docs/01-m-overview',
           activeBasePath: 'docs',
           label: 'Docs',
           position: 'left',
@@ -36,7 +36,7 @@ module.exports = {
           items: [
             {
               label: 'Overview',
-              to: 'docs/01-overview',
+              to: 'docs/01-m-overview',
             },
             {
               label: 'Download and install',

+ 8 - 5
docs/sidebars.js

@@ -1,12 +1,15 @@
 module.exports = {
   someSidebar: {
     'Users Manual': [
-        '01-overview',
-        '02-download-install',
-        '03-metrics'
+        '01-m-overview',
+        '02-m-download-install',
+        '03-m-getting-started',
+        '04-m-workflow',
+        '05-m-extending-tool',
+        '06-m-feeback-contribute'
     ],
-    Features: [
-        'mdx'
+    'Developers Manual': [
+        '01-d-file'
     ],
   },
 };

BIN
docs/src/img/piechart.png


+ 1 - 1
docs/src/pages/index.js

@@ -101,7 +101,7 @@ function Home() {
                 'button button--outline button--secondary button--lg',
                 styles.getStarted,
               )}
-              to={useBaseUrl('docs/01-overview')}>
+              to={useBaseUrl('docs/01-m-overview')}>
               Get Started
             </Link>
           </div>