Skip to content

Commit

Permalink
Spot a few Demeter law violations
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Aug 6, 2018
1 parent b307e90 commit 78a6f72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GRDB/Core/RowAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,12 @@ struct AdaptedRowImpl : RowImpl {

func hasNull(atUncheckedIndex index: Int) -> Bool {
let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index)
return base.impl.hasNull(atUncheckedIndex: mappedIndex)
return base.impl.hasNull(atUncheckedIndex: mappedIndex) // base.impl: Demeter violation
}

func databaseValue(atUncheckedIndex index: Int) -> DatabaseValue {
let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index)
return base.impl.databaseValue(atUncheckedIndex: mappedIndex)
return base.impl.databaseValue(atUncheckedIndex: mappedIndex) // base.impl: Demeter violation
}

func fastDecode<Value: DatabaseValueConvertible & StatementColumnConvertible>(
Expand All @@ -507,7 +507,7 @@ struct AdaptedRowImpl : RowImpl {
debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Value
{
let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index)
return try base.impl.fastDecode(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo)
return try base.impl.fastDecode(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation
}

func fastDecodeIfPresent<Value: DatabaseValueConvertible & StatementColumnConvertible>(
Expand All @@ -516,15 +516,15 @@ struct AdaptedRowImpl : RowImpl {
debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Value?
{
let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index)
return try base.impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo)
return try base.impl.fastDecodeIfPresent(Value.self, atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation
}

func dataNoCopy(
atUncheckedIndex index:Int,
debugInfo: @autoclosure () -> ValueConversionDebuggingInfo) throws -> Data?
{
let mappedIndex = mapping.baseColumnIndex(atMappingIndex: index)
return try base.impl.dataNoCopy(atUncheckedIndex: mappedIndex, debugInfo: debugInfo)
return try base.impl.dataNoCopy(atUncheckedIndex: mappedIndex, debugInfo: debugInfo) // base.impl: Demeter violation
}

func columnName(atUncheckedIndex index: Int) -> String {
Expand Down

0 comments on commit 78a6f72

Please sign in to comment.