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

Establish a structure for devportal tutorials #46

Closed
3 tasks done
relativityboy opened this issue Mar 22, 2018 · 3 comments
Closed
3 tasks done

Establish a structure for devportal tutorials #46

relativityboy opened this issue Mar 22, 2018 · 3 comments
Assignees
Labels
2 - SW Steemworks Points

Comments

@relativityboy
Copy link
Contributor

relativityboy commented Mar 22, 2018

We need a consistent pattern for all developer portal tutorials so users know how to orient themselves when entering a new tutorial.

  • establish a structure for the text portion of all tutorials
  • establish conventions for the 'new code complexity' of tutorials
  • describe the above in a comment on this issue with the title Results
@inertia186 inertia186 self-assigned this Mar 22, 2018
@inertia186
Copy link
Contributor

inertia186 commented Mar 23, 2018

Results

Structure

# Title / Overview

An explanation for the purpose of what this tutorial teaches.

## Simple Arguments

Basic usage that is shown in the tutorial.

## Advanced Arguments

Expanded usage including things like how to use api features to filter or paginate the
result.

## Expanded Results

Although the tutorial might demonstrate a specific task, this section should expand on all
of the output of the methods.

## How To Run

Briefly show how to run this specific example.

## Troubleshooting

Should be specific gotchas to the topic, not general troubleshooting.

### First (most common) situation briefly describing a complication

A detailed description of the situation.

A solution, workaround, or other compensating control

### Next (most common) situation briefly describing a complication

A detailed description of the situation.

A solution, workaround, or other compensating control

Code Complexity

We can use two methods for determining new code complexity. Eyeball (subjective) methods just determine:

  • Cyclomatic complexity per method appears low (limited number of logical branches; few loops).
  • Number of arguments to methods appears low.
  • Length of methods appears limited to 50 lines.

Or use lizard to get an objective number, see:

https://github.com/terryyin/lizard

It's a fairly simple tool. Suggested usage for examples with example modules:

lizard -C 5 -a 5 -L 50 public/app.js

Result:

================================================
  NLOC    CCN   token  PARAM  length  location
------------------------------------------------
      22      2    194      0      23 fetchBlog@3-25@public/app.js
1 file analyzed.
==============================================================
NLOC    Avg.NLOC  AvgCCN  Avg.token  function_cnt    file
--------------------------------------------------------------
     24      22.0     2.0      194.0         1     public/app.js

========================================================================================
No thresholds exceeded (cyclomatic_complexity > 5 or length > 50 or parameter_count > 5)
==========================================================================================
Total nloc   Avg.NLOC  AvgCCN  Avg.token   Fun Cnt  Warning cnt   Fun Rt   nloc Rt
------------------------------------------------------------------------------------------
        24      22.0     2.0      194.0        1            0      0.00    0.00

This result implies low code complexity for public/app.js.

@relativityboy
Copy link
Contributor Author

Nice work.

@inertia186
Copy link
Contributor

I also think it would be trivial to add bin/check_complexity.sh in the project to quickly check the examples for deviations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - SW Steemworks Points
Projects
None yet
Development

No branches or pull requests

2 participants