codeclimate/test-reporter

View on GitHub
formatters/gcov/examples/Calculator.swift.gcov

Summary

Maintainability
Test Coverage
    -:    0:Source:examples/Calculator.swift
    -:    0:Runs:1
    -:    0:Programs:1
    -:    1://
    -:    2://  Calculator.swift
    -:    3://  ExampleFramework
    -:    4://
    -:    5://  Created by Kishikawa Katsumi on 2015/05/27.
    -:    6://  Copyright (c) 2015 Realm. All rights reserved.
    -:    7://
    -:    8:
    -:    9:import Foundation
    -:   10:
    -:   11:public class Calculator {
    8:   12:    public var x: Int?
    8:   13:    public var y: Int?
    -:   14:
    -:   15:    public init() { }
    -:   16:
    -:   17:    public init(a: Int, b: Int) {
    2:   18:        x = a
    2:   19:        y = b
    -:   20:    }
    -:   21:
    -:   22:    public func add(a: Int, b: Int) -> Int {
    1:   23:        if let x = x {
#####:   24:            y = x
    -:   25:        }
    1:   26:        if let y = y {
#####:   27:            x = y
    -:   28:        }
    1:   29:        return a + b
    -:   30:    }
    -:   31:
    -:   32:    public func sub(a: Int, b: Int) -> Int {
    1:   33:        if let x = x {
    1:   34:            y = x
    -:   35:        }
    1:   36:        if let y = y {
    1:   37:            x = y
    -:   38:        }
    1:   39:        return a - b
    -:   40:    }
    -:   41:
    -:   42:    public func mul(a: Int, b: Int) -> Int {
    1:   43:        if let x = x {
    1:   44:            y = x
    -:   45:        }
    1:   46:        if let y = y {
    1:   47:            x = y
    -:   48:        }
    1:   49:        return a * b
    -:   50:    }
    -:   51:
    -:   52:    public func div(a: Int, b: Int) -> Int {
#####:   53:        if let x = x {
#####:   54:            y = x
    -:   55:        }
#####:   56:        if let y = y {
#####:   57:            x = y
    -:   58:        }
#####:   59:        return a / b
    -:   60:    }
    -:   61:}