Options
All
  • Public
  • Public/Protected
  • All
Menu

Faubourg Simone: mobile app GitHub license Twitter Follow

Source code of Faubourg Simone mobile applications built with Ionic.


Get it on Google Play
Get it on Apple Store
Build Status
Sonar quality gate
Code Climate
Sonar Coverage
Maintenance
GitHub last commit
Open issues
Greenkeeper badge
Dependencies Status
DevDependencies Status

Features

  • Listening to our radio
  • See content of our website: Pola / Calepins / Dans le casque

For Developers

Prerequisites

Be sure Ionic and Cordova are installed:

cordova -v
ionic -v

If it's not the case, run npm install -g ionic cordova.

You also needs sdks:

  • For Android development we recommand to install Android Studio.
  • For IOS you don't have the choice: you need XCode

Run ionic info to be sure your system is ok.

Installation

git clone git@github.com:proustibat/fbrgsmn.mobile.app.git
cd fbrgsmn.mobile.app
ionic cordova prepare

Answer Y to the following question to run npm install automatically:

? Looks like a fresh checkout! No ./node_modules directory found. Would you like to install project dependencies? (Y/n)

Watching

In a browser

ionic serve -l

On a device

ionic cordova run android -l -c -s

On a simulator

ionic cordova emulate ios --target="iPhone-8"

Code documentation is available here

Building

ionic cordova build ios android

Testing

Config files are in 'test-config' folder. Mocks file are in 'test-config/mocks', if you need to add some, please add it here.

Unit testing

npm run test

It starts Karma to watch tests and work on them. Each file of the sources matches a test file with '.spec.ts' extension. We choose the Jasmine framework (v2.8), so if you're not familiar, please read the documentation

E2E Testing

npm run e2e

It runs Protractor. Protractor is a Node.js program, and runs end-to-end tests that are also written in JavaScript and run with node. Protractor uses WebDriver to control browsers and simulate user actions. Note that you need to run ionic serve -l before running e2e tests

Tests linting

By default, tests are removed from tslint and tslint:codeclimate scripts because of incompatible rules. They should be checked with npm run tslint:tests

Contributing

Recommandations

Use Gitflow Worklow

We use Gitflow Workflow. Please follow this branching model. Once your branch is pushed (hotfix or feature), make a pull request here. Travis will check if tests are passed and we'll accept your PR depending on results.

Check your contribution before submitting it

Linting

Be sure your code is alright: run npm run all-custom-lint and npm run lint. Also run npm run test-ci to be sure your work will be accepted on our Travis CI process.

Config files are in source code:

  • tslint.json ( and tslint-tests.json, tslint-tests.json, tslint-codeclimate.json)
  • tsconfig.json ( contains typedoc options )
  • .stylelintrc
  • .scss-lint.yml
  • .editorconfig
  • .codeclimate.yml

Don't hesitate to create an issue if you wanna change its and discuss about theses changes.

If you wanna be perfect :-) install CodeClimate and use npm run codeclimate:analyze to see what will displayed on our CodeClimate Dashboard

Tests and Coverage

Please run or add unit tests and e2e tests if needed. Make sure it covers the right parts. You can use npm run test-coverage to see the code coverage. It will create a coverage folder, the same that is automatically published here

Update the documentation

If you update the code documentation or add commented code, you could check your changes by running npm run typedoc, it will create a 'documentation' folder. This will be published automatically on the public documentation

Support

If you are having issues, please let us know: tech.team@faubourgsimone.com

License

The project is licensed under the GNU Affero General Public License v3.0 license


Tools Summary

Travis CI

Triggered at each push action on the repo (on any branches). You could see our dashboard here Used to run tests, linting, generate code coverage results and code documentation. Then it publishes it on our public results.

CodeClimate

Our dashboard is updated at each push.

Sonarqube

We use Sonarqube on Sonarcloud.io to keep our code safe. Our dashboard is available here: https://sonarcloud.io/dashboard?id=fbrgsmn.mobile.app

Greenkeeper

It's a real-time monitoring and automatic updates for npm dependencies. If an update is available on our dependencies, it updates it on a specific branch and creates a pull request. Travis will then be triggered, if tests are passed we can accept the pull request. Learn more about it here

Typedoc

A documentation generator for TypeScript projects: our results are here Learn more about it here

Commitizen

If you wanna contribute to the project and create a pull request, use it by running git cz instead of git commit. Learn more about it here


A glance at our actual Sonarqube metrics

Complexity

How simple or complicated the control flow of the application is.

Complexity Complexity per file Cognitive Complexity

Cyclomatic Complexity measures the minimum number of test cases requiref for full test coverage. Cognitive Complexity is a measure of how difficult the application is to understand

Complexity for Javascript or typescript is incremented by one for each:

  • function (i.e non-abstract and non-anonymous constructors, functions, procedures or methods)
  • if statement
  • short-circuit (AKA lazy) logical conjunction (&&)
  • short-circuit (AKA lazy) logical disjunction (||)
  • ternary conditional expressions
  • loop
  • case clauses of a switch statement
  • throw and catch statement
  • return statement (except when it is the very last statement of a function)

Complexity of the web page is measured by counting the decision tags (such as if and forEach) and boolean operators in expressions (&& and ||), plus one for the body of the document. The decision tags and the operators are configurable through the Complexity rule.

Documentation & sizes

Lines Lines of code Comment lines Comments (%)

Directories Files Classes Functions

Duplications

Duplicated blocks Duplicated lines

Issues

Open issues Confirmed issues Won't fix issues

Maintainability

Issues in this domain mark code that will be more difficult to update competently than it should

Code smells SQALE Rating

Rating given to the project related to the value of the Technical Debt Ratio. The default Maintainability Rating grid is:

  • A=0-0.05,
  • B=0.06-0.1,
  • C=0.11-0.20,
  • D=0.21-0.5,
  • E=0.51-1

The Maintainability rating scale can be alternately stated by saying that if the outstanding remediation cost is:

  • <=5% of the time that has already gone into the application, the rating is A
  • between 6 to 10% the rating is a B
  • between 11 to 20% the rating is a C
  • between 21 to 50% the rating is a D
  • anything over 50% is an E

Technical debt

Effort to fix all maintainability issues. The measure is stored in minutes. An 8-hour day is assumed when values are shown in days. (The value of the cost to develop a line of code is 0.06 days)

Technical debt Technical debt ratio

Reliability

Issues in this domain mark code where you will get behavior other than what was expected.

Bugs Reliability remediation effort Reliability Rating

Reliability remediation effort

Effort to fix all bug issues. The measure is stored in minutes. An 8-hour day is assumed when values are shown in days.

Reliability rating

  • A or 1 = 0 Bug
  • B or 2 = at least 1 Minor Bug
  • C or 3 = at least 1 Major Bug
  • D or 4 = at least 1 Critical Bug
  • E or 5 = at least 1 Blocker Bug

Security

Vulnerabilities Security remediation effort Security Rating

Security remediation effort

Effort to fix all vulnerability issues. The measure is stored in minutes in the DB. An 8-hour day is assumed when values are shown in days.

Security rating

  • A = 0 Vulnerability
  • B = at least 1 Minor Vulnerability
  • C = at least 1 Major Vulnerability
  • D = at least 1 Critical Vulnerability
  • E = at least 1 Blocker Vulnerability

Index

Variables

Const CustomComponents

CustomComponents: (MainHeaderComponent | ShareButtonComponent | PlayerComponent)[] = [MainHeaderComponent,ShareButtonComponent,PlayerComponent]

Const CustomDirectives

CustomDirectives: ParallaxHeader[] = [ParallaxHeader]

Const CustomProviders

CustomProviders: (GlobalService | MusicControlsManagerProvider | InitService | PromptService | RadioService | TrackerService)[] = [GlobalService,InitService,PromptService,RadioService,TrackerService,MusicControlsManagerProvider]

Const ExternalComponents

ExternalComponents: any[] = []

Const ExternalProviders

ExternalProviders: (SplashScreen | GoogleAnalytics | InAppBrowser | BackgroundMode | SocialSharing | Screenshot | Media | MusicControls | object)[] = [StatusBar,SplashScreen,GoogleAnalytics,InAppBrowser,BackgroundMode,SocialSharing,Screenshot,Media,MusicControls,{ provide: ErrorHandler, useClass: IonicErrorHandler }]

Let FB

FB: any

Const Pages

Pages: (RadioPage | TabsPage)[] = [TabsPage,RadioPage]

Let cordova

cordova: any

Functions

HttpLoaderFactory

  • HttpLoaderFactory(http: HttpClient): TranslateHttpLoader

Object literals

Const appSettings

appSettings: object

backButtonText

backButtonText: string = "Retour"

statusbarPadding

statusbarPadding: boolean = true

tabsHideOnSubPages

tabsHideOnSubPages: boolean = true

tabsHighlight

tabsHighlight: boolean = true

tabsPlacement

tabsPlacement: string = "bottom"