Browse Source

Doc: Fix various Codacy formatting issues

Stefan Profanter 5 years ago
parent
commit
aa3c4be4ba
8 changed files with 89 additions and 214 deletions
  1. 10 10
      CODE_OF_CONDUCT.md
  2. 3 3
      CONTRIBUTING.md
  3. 34 34
      FEATURES.md
  4. 3 8
      ISSUE_TEMPLATE.md
  5. 9 5
      README.md
  6. 22 7
      arch/Readme.md
  7. 3 3
      tests/fuzz/README.md
  8. 5 144
      tools/nodeset_compiler/README.md

+ 10 - 10
CODE_OF_CONDUCT.md

@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
 
 Examples of behavior that contributes to creating a positive environment include:
 
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
 
 Examples of unacceptable behavior by participants include:
 
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
 
 ## Our Responsibilities
 

+ 3 - 3
CONTRIBUTING.md

@@ -75,9 +75,9 @@ The following points will be especially looked at during the review.
 
 These labels can be used for the PR title to indicate its status.
 
-- [WIP]: The PR is work in progress and at this point simply informative.
-- [Review]: The PR is ready from the developers perspective. He requests a review from a core-maintainer.
-- [Discussion]: The PR is a contribution to ongoing technical discussions. The PR may be incomplete and is not intended to be merged before the discussion has concluded.
+- `[WIP]`: The PR is work in progress and at this point simply informative.
+- `[Review]`: The PR is ready from the developers perspective. He requests a review from a core-maintainer.
+- `[Discussion]`: The PR is a contribution to ongoing technical discussions. The PR may be incomplete and is not intended to be merged before the discussion has concluded.
 
 The core-maintainers are busy people. If they take especially long to react,
 feel free to trigger them by additional comments in the PR thread. Again, small

+ 34 - 34
FEATURES.md

@@ -4,27 +4,27 @@ open62541 Supported Features
 OPC UA Stack
 ------------
 
-|                                         |                      |                      |
-| --------------------------------------- |:--------------------:| -------------------- |
-| **Encoding **                           |                      |                      |
-| OPC UA Binary                           |  :heavy_check_mark:  |                      |
-| OPC UA JSON                             |      :new_moon:      | WIP for Release 0.4  |
-| OPC UA XML                              |      :new_moon:      |                      |
-| **Transport**                           |                      |                      |
-| UA-TCP UA-SC UA Binary                  |  :heavy_check_mark:  |                      |
-| OPC UA HTTPS                            |      :new_moon:      |                      |
-| SOAP-HTTP WS-SC UA Binary               |      :new_moon:      |                      |
-| SOAP-HTTP WS-SC UA XML                  |      :new_moon:      |                      |
-| SOAP-HTTP WS-SC UA XML-UA Binary        |      :new_moon:      |                      |
-| **Encryption**                          |                      |                      |
-| None                                    |  :heavy_check_mark:  |                      |
-| Basic128Rsa15                           |  :heavy_check_mark:  | master, Release 0.3  |
-| Basic256                                |  :heavy_check_mark:  | master, Release 0.3  |
-| Basic256Sha256                          |  :heavy_check_mark:  | master, Release 0.3  |
-| **Authentication**                      |                      |                      |
-| Anonymous                               |  :heavy_check_mark:  |                      |
-| User Name Password                      |  :heavy_check_mark:  |                      |
-| X509 Certificate                        |      :new_moon:      |                      |
+|                                         |                    |                      |
+| --------------------------------------- |:------------------:| -------------------- |
+| **Encoding**                            |                    |                      |
+| OPC UA Binary                           | :heavy_check_mark: |                      |
+| OPC UA JSON                             |     :new_moon:     | WIP for Release 0.4  |
+| OPC UA XML                              |     :new_moon:     |                      |
+| **Transport**                           |                    |                      |
+| UA-TCP UA-SC UA Binary                  | :heavy_check_mark: |                      |
+| OPC UA HTTPS                            |     :new_moon:     |                      |
+| SOAP-HTTP WS-SC UA Binary               |     :new_moon:     |                      |
+| SOAP-HTTP WS-SC UA XML                  |     :new_moon:     |                      |
+| SOAP-HTTP WS-SC UA XML-UA Binary        |     :new_moon:     |                      |
+| **Encryption**                          |                    |                      |
+| None                                    | :heavy_check_mark: |                      |
+| Basic128Rsa15                           | :heavy_check_mark: | master, Release 0.3  |
+| Basic256                                | :heavy_check_mark: | master, Release 0.3  |
+| Basic256Sha256                          | :heavy_check_mark: | master, Release 0.3  |
+| **Authentication**                      |                    |                      |
+| Anonymous                               | :heavy_check_mark: |                      |
+| User Name Password                      | :heavy_check_mark: |                      |
+| X509 Certificate                        |     :new_moon:     |                      |
 
 OPC UA Server
 -------------
@@ -55,8 +55,8 @@ OPC UA Server
 |                             | QueryNext()                     |      :new_moon:      |                      |
 | Attribute Service Set       | Read()                          |  :heavy_check_mark:  |                      |
 |                             | Write()                         |  :heavy_check_mark:  |                      |
-|                             | HistoryRead()                   | :waning_gibbous_moon: | [WIP](https://github.com/open62541/open62541/pull/1740), Release 0.4     |
-|                             | HistoryUpdate()                 | :waning_gibbous_moon: | [WIP](https://github.com/open62541/open62541/pull/1740), Release 0.4     |
+|                             | HistoryRead()                   | :waning_gibbous_moon: | [WIP](https://github.com/open62541/open62541/pull/1740), Release 0.4 |
+|                             | HistoryUpdate()                 | :waning_gibbous_moon: | [WIP](https://github.com/open62541/open62541/pull/1740), Release 0.4 |
 | Method Service Set          | Call()                          |  :heavy_check_mark:  |                      |
 | MonitoredItems Service Set  | CreateMonitoredItems()          |  :heavy_check_mark:  | See below for Events |
 |                             | DeleteMonitoredItems()          |  :heavy_check_mark:  |                      |
@@ -71,18 +71,18 @@ OPC UA Server
 |                             | DeleteSubscriptions()           |  :heavy_check_mark:  |                      |
 |                             | TransferSubscriptions()         |      :new_moon:      |                      |
 
-| **Subscriptions**                       |                      |                      |
-| --------------------------------------- |:--------------------:| -------------------- |
-| DataChange MonitoredItems               |  :heavy_check_mark:  | master, Release 0.3  |
-| DataChange Filters                      |  :heavy_check_mark:  | master               |
-| Event MonitoredItems                    |  :heavy_check_mark:  | master               |
-| Event Filters                           |      :new_moon:      |                      |
+| **Subscriptions**                       |                    |                      |
+| --------------------------------------- |:------------------:| -------------------- |
+| DataChange MonitoredItems               | :heavy_check_mark: | master, Release 0.3  |
+| DataChange Filters                      | :heavy_check_mark: | master               |
+| Event MonitoredItems                    | :heavy_check_mark: | master               |
+| Event Filters                           |     :new_moon:     |                      |
 
-| **Discovery**                           |                      | See Discovery Service Set |
-| --------------------------------------- |:--------------------:| -------------------- |
-| Local Disovery Server                   |  :heavy_check_mark:  | master, Release 0.3  |
-| Local Discovery Server Multicast Ext.   |  :heavy_check_mark:  | master, Release 0.3  |
-| Global Discovery Server                 |      :new_moon:      |                      |
+| **Discovery**                           |                    | See Discovery Service Set |
+| --------------------------------------- |:------------------:| -------------------- |
+| Local Disovery Server                   | :heavy_check_mark: | master, Release 0.3  |
+| Local Discovery Server Multicast Ext.   | :heavy_check_mark: | master, Release 0.3  |
+| Global Discovery Server                 |     :new_moon:     |                      |
 
 OPC UA Client
 -------------

+ 3 - 8
ISSUE_TEMPLATE.md

@@ -13,17 +13,12 @@ Fill out the sections and checklist below (add text at the end of each line).
 --------------------------------------------------------------------------------
 -->
 
-Description
-===========
+## Description
 
+## Background Information / Reproduction Steps
 
-Background Information / Reproduction Steps
-===========================================
+## Checklist
 
-
-
-Checklist
-=========
 Please provide the following information:
 
  - [ ] open62541 Version (release number or git tag):

File diff suppressed because it is too large
+ 9 - 5
README.md


+ 22 - 7
arch/Readme.md

@@ -1,8 +1,19 @@
-# To port to a new architecture you should follow this file:
+# open62541 Architectures 
+
+The `arch` folder contains all the architecture-specific code for a given operating system.
+
+The list of supported architectures is also available as a CMake option.
+
+## Adding new architectures
+
+To port to a new architecture you should follow these steps:
 
 1. Create a folder with your architecture, let's call it new_arch
+
 2. In the CMakeLists.txt file located next to this file, add `add_subdirectory(new_arch)` at the end of it
+
 3. Create a CMakeLists.txt file in the new_arch folder
+
 4. Use the following template for it (remember that when you see new_arch you should replace with the name of your architecture)
     ```C
     # ---------------------------------------------------
@@ -39,15 +50,19 @@
     ```
 5. Create a ua_clock.c file that implements the following functions defined in ua_types.h:
 
-    UA_DateTime UA_DateTime_now(void);
-    UA_Int64 UA_DateTime_localTimeUtcOffset(void);
-    UA_DateTime UA_DateTime_nowMonotonic(void);
+   * UA_DateTime UA_DateTime_now(void);
+   
+   * UA_Int64 UA_DateTime_localTimeUtcOffset(void);
+   
+   * UA_DateTime UA_DateTime_nowMonotonic(void);
 
 6. Create a file in the folder new_arch called ua_architecture.h
 
-7. Use the following template for it:
-  a: Change YEAR, YOUR_NAME and YOUR_COMPANY in the header
-  b: Change NEW_ARCH at the beginning in PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTURE_H_ for your own name in uppercase
+7. Use the following template for it:  
+
+   * Change YEAR, YOUR_NAME and YOUR_COMPANY in the header
+   
+   * Change NEW_ARCH at the beginning in PLUGINS_ARCH_NEW_ARCH_UA_ARCHITECTURE_H_ for your own name in uppercase  
    
     ```C
     /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.

+ 3 - 3
tests/fuzz/README.md

@@ -7,12 +7,12 @@ https://github.com/google/oss-fuzz
 Currently tested is processing of binary messages and encoding/decoding of
 binary encoded data.
 
-# Status
+## Status
 
 * [Build status](https://oss-fuzz-build-logs.storage.googleapis.com/index.html)
 * [Open issues](https://bugs.chromium.org/p/oss-fuzz/issues/list?q=label:Proj-open62541)
 
-# Update the corpus
+## Update the corpus
 
 To update the current corpus used for fuzzing you need to follow these steps.
 It will execute all the unit tests, dump the received data packages to a directory
@@ -32,4 +32,4 @@ and then update and merge the corpus.
 
    `open62541/fuzz/fuzz_binary_message_corpus/generated`
    
-   Commit the new files and then you can delete the build directories created in step 1.
+   Commit the new files and then you can delete the build directories created in step 1.

+ 5 - 144
tools/nodeset_compiler/README.md

@@ -1,148 +1,9 @@
-pyUANamespace
-=============
+# open62541 nodeset Compiler
 
-pyUANamespace is a collection of python 2 scripts that can parse OPC UA XML Namespace definition files and transform them into a class representation. This facilitates both reprinting the namespace in a different non-XML format (such as C-Code or DOT) and analysis of the namespace structure.
+The nodeset compiler is a collection of python scripts that can parse OPC UA XML Namespace definition files and transform them into a class representation. This facilitates both reprinting the namespace in a different non-XML format (such as C-Code or DOT) and analysis of the namespace structure.
 
-### Documentation
+The initial implementation has been contributed by a research project of the chair for Process Control Systems Engineering of the TU Dresden. It was not strictly speaking created as a C generator, but could be easily modified to fulfill this role for open62541. Later on it was extended and improved by the core developers of open62541.
 
-The pyUANamespace implementation has been contributed by a research project of the chair for Process Control Systems Engineering of the TU Dresden. It was not strictly speaking created as a C generator, but could be easily modified to fulfill this role for open62541.
+## Documentation
 
-## Functionality in open62541
-
-In open62541, the linked python namespace generated by the pyUANamespace classes are used to print C-Code that will automatically initialize a server. Apart from parsing XML, most classes also have a printOpen62541Header() or printOpen62541Header_Subtype() function that can reprint the node as C Code compatible with the project.
-
-This function has been wrapped into the generate_open62541CCode.py program, which implements the compiler and option checking relevant to this task. The program is called as follows:
-
-```bash
-$ python generate_open62541CCode.py /path/to/NodeSet.xml /path/to/outputfile.c
-```
-
-Several options have been made available to further facilitate header generation. Calling the script without arguments will produce a usage helper listing all available options.
-
-# Overwriting NodeSet definitions
-
-Most notably, any number of XML files can be passed. The latest XML definition of a node found is used.
-
-```bash
-$ python generate_open62541CCode.py /path/to/NodeSet0.xml /path/to/OverwriteNodeSet0.xml /path/to/outputfile.c
-```
-
-# Blacklisting Nodes
-
-If a set of nodes is not to be contained in the namespace, they can be specified as a blacklist file containing one nodeId per line in the following format:
-
-```
-ns=1;id=2323
-id=11122;
-```
-
-This file can be passed to the compiler, which will remove these nodes prior to linking the namespace.
-
-```bash
-$ python generate_open62541CCode.py -b blacklist.txt /path/to/NodeSet.xml /path/to/outputfile.c
-```
-
-In this particular example, nodes `ns=1;id=2323` and `ns=0;id=11122` will be removed from the namespace (which may invalidate other nodes referring to them).
-
-# Ignoring Nodes
-
-Blacklisting removes nodes, which means that any other nodes referring to these nodes will contain invalid references. If a namespace should be generated that can use all datatypes, objectstypes, etc., but should only print specific nodes into the C Header, a set of nodes can be ignored. This will cause the compiler to use them in the linked namespace where other nodes can use them (e.g. in buildEncodingRules()), but they will not appear as part of the header file.
-
-Ignorelists have the same format as blacklists and are passed to the compiler like so:.
-
-```bash
-$ python generate_open62541CCode.py -i ignorelist.txt /path/to/NodeSet.xml /path/to/outputfile.c
-```
-
-Given the blacklist example, the nodes `ns=1;id=2323` and `ns=0;id=11122` will not be part of the header, but other nodes may attempt to create references to them or use them as dataTypes.
-
-# Suppressing attributes
-
-Most of OPC UA Namespaces depend heavily on strings. These can bloat up memory usage in applications where memory is a critical resource. The compiler can be instructed to suppress allocation for certain attributes, which will be initialized to sensible defaults or NULL pointers where applicable.
-
-```bash
-$ python generate_open62541CCode.py -s browsename -s displayname -s nodeid /path/to/NodeSet.xml /path/to/outputfile.c
-```
-
-Currently, the following base attributes of nodes can be suppressed:
-- browseName
-- displayName
-- description
-- nodeId
-- writeMask
-- userWriteMask
-
-Further attributes may be added at a later point depending on demand.
-
-## Core functionality
-
-OPC UA node types, base data types and references are described in ua_node_types.py and ua_builtin_types.py. These classes are primarily intended to act as part of an AST to parse OPC UA Namespace description files. They implement a hierarchic/recursive parsing of XML DOM objects, supplementing their respective properties from the XML description.
-
-A manager class called NodeSet is included in the respective source file. This class does _not_ correspond to a OPC UA Namespace. It is an aggregator and manager for nodes and references which may belong to any number of namespaces. This class includes extensive parsing/validation to ensure that a complete and consistent namespace is generated.
-
-## Namespace compilation internals
-
-Compiling a namespace consists of the following steps:
-- Read one or more XML definitions
-- Link references to actual nodes (also includes references to dataTypes, etc.)
-- Sanitize/Remove any nodes and references that could not be properly parsed
-- Derive encoding rules for datatypes
-- Parse/Allocate variable values according to their dataType definitions
-
-
-Reading and parsing XML files is handled by NodeSet.parseXML(/path/to/file.xml). It is the first part of a multipass compiler that will create all nodes contained in the XML description.
-
-During the reading of XML files, nodes will attempt to parse any attributes they own, but not refer to any other nodes. References will be kept as XML descriptions. Any number of XML files can be read in this phase. __NOTE__: In the open62541 (this) implementation, duplicate nodes (same NodeId) are allowed. The last definition encountered will be kept. This allows overwriting specific nodes of a much larger XML file to with implementation specific nodes.
-
-The next phase of the compilation is to link all references. The phase is called by NodeSet.linkOpenPointers(). All references will attempt to locate their target() node in the namespace and point to it.
-
-During the sanitation phase called by NodeSet.sanitize(), nodes check themselves for invalid attributes. Most notably any references that could not be resolved to a node will be removed from the nodes.
-
-When calling NodeSet.buildEncodingRules(), dataType nodes are examined to determine if and how the can be encoded as a serialization of OPC UA builtin types as well as their aliases.
-
-The following fragment of a variable value can illustrate the necessity for determining encoding rules:
-```xml
-<Argument>
-    <Name>ServerHandles</Name>
-    <DataType>
-    <Identifier>i=7</Identifier>
-    </DataType>
-    <ValueRank>1</ValueRank>
-    <ArrayDimensions />
-    <Description p5:nil="true" xmlns:p5="http://www.w3.org/2001/XMLSchema-instance" />
-</Argument>
-```
-The tags body, TypeId, Identifier, and Argument are aliases for builtin encodings or structures thereof. Without knowing which type they represent, an appropriate value class (and with that a parser) cannot be created. pyUANamespace will resolve this specific case by determining the encoding as follows:
-```
-LastMethodOutputArguments : Argument -> i=296
-+ [['Name', ['String']], ['DataType', ['NodeId']], ['ValueRank', ['Int32']], ['ArrayDimensions', ['UInt32']], ['Description', ['LocalizedText']]] (already analyzed)
-
-```
-
-DataTypes that cannot be encoded as a definite serial object (e.g., by having a member of NumericType, but not a specific one), will have their isEncodable() attribute disabled. All dataTypes that complete this node can be used to effectively determine the size and serialization properties of any variables.
-
-Having encoding rules means that data can now be parsed when a <Value> tag is encountered in a description. Calling NodeSet.allocateVariables() will do just that for any variable node that holds XML Values.
-
-The result of this compilation is a completely linked and instantiated OPC UA namespace.
-
-An example compiler can be built as follows:
-```python
-class testing:
-  def __init__(self):
-    self.namespace = NodeSet("testing")
-
-    log(self, "Phase 1: Reading XML file nodessets")
-    self.namespace.parseXML("Opc.Ua.NodeSet2.xml")
-    self.namespace.parseXML("DeviceNodesSet.xml")
-    self.namespace.parseXML("MyNodesSet.xml")
-
-    log(self, "Phase 2: Linking address space references and datatypes")
-    self.namespace.linkOpenPointers()
-    self.namespace.sanitize()
-
-    log(self, "Phase 3: Comprehending DataType encoding rules")
-    self.namespace.buildEncodingRules()
-
-    log(self, "Phase 4: Allocating variable value data")
-    self.namespace.allocateVariables()
-```
+Usage documantation and How-Tos can be found on the webpage: <https://open62541.org/doc/current/nodeset_compiler.html>