Skip to content

Adding sq #11

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
push:
branches:
- master
- adding_sq
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@v3
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# We do not recommend to use this in a pull request. Prefer using pull request
# decoration instead.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}g
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.scannerwork/
.vscode/
5 changes: 3 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* Manages the data of the application.
*/
// FIXME here
class Model {
constructor() {
this.todos = JSON.parse(localStorage.getItem('todos')) || []
Expand Down Expand Up @@ -31,7 +32,7 @@ class Model {

editTodo(id, updatedText) {
this.todos = this.todos.map(todo =>
todo.id === id ? { id: todo.id, text: updatedText, complete: todo.complete } : todo
todo.id == id ? { id: todo.id, text: updatedText, complete: todo.complete } : todo
)

this._commit(this.todos)
Expand All @@ -45,7 +46,7 @@ class Model {

toggleTodo(id) {
this.todos = this.todos.map(todo =>
todo.id === id ? { id: todo.id, text: todo.text, complete: !todo.complete } : todo
todo.id == id ? { id: todo.id, text: todo.text, complete: !todo.complete } : todo
)

this._commit(this.todos)
Expand Down
1 change: 1 addition & 0 deletions script.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
*/
var Model =
/*#__PURE__*/
// FIXME hi
function () {
function Model() {
_classCallCheck(this, Model);
Expand Down
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.projectKey=mahwishriazjamil_mvc_b684ff3b-915c-4f57-b2af-55705d9be0f4
sonar.sources=script.js,script.min.js
sonar.javascript.file.suffixes=.min.js,.js
sonar.inclusions=**/*.js