Showing 188 of 188 total issues
Reduce duplication Open
Open
Map.keys values `shouldBe` ["g"]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
Map.keys values `shouldBe` ["g"]
let VGraph g = Ann.drop $ values Map.! "g"
g `shouldBe`
fromNodesAndEdges tgraph [(Node 0 "n1", 1), (Node 1 "n2", 1)]
[(Edge 0 0 1 "e1", 1), (Edge 1 0 1 "e2", 1)]
Perhaps
Combine with tests/GrLang/CompilerSpec.hs:182:7
Use $> Open
Open
<|> (reserved "EF" *> pure (E . F))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
reserved "EF" *> pure (E . F)
Perhaps
reserved "EF" Data.Functor.$> (E . F)
Redundant bracket Open
Open
(\(e,src,tgt) b ->
(createEdgeOnDomain e src tgt (edgeTypesInA e) e
(createNodeOnDomain tgt (nodeTypesInA tgt) tgt
(createNodeOnDomain src (nodeTypesInA src) src b)
)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
\ (e, src, tgt) b ->
(createEdgeOnDomain e src tgt (edgeTypesInA e) e
(createNodeOnDomain tgt (nodeTypesInA tgt) tgt
(createNodeOnDomain src (nodeTypesInA src) src b)))
Perhaps
\ (e, src, tgt) b ->
createEdgeOnDomain e src tgt (edgeTypesInA e) e
(createNodeOnDomain tgt (nodeTypesInA tgt) tgt
(createNodeOnDomain src (nodeTypesInA src) src b))
Move guards forward Open
Open
edgesFromA = [(edgeId e, u, v) |
e <- orphanTypedEdges m,
u <- nodeIds (domain edgesL'),
v <- nodeIds (domain edgesL'),
sourceId e == applyNodeIdUnsafe edgesL' u,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
[(edgeId e, u, v) | e <- orphanTypedEdges m,
u <- nodeIds (domain edgesL'), v <- nodeIds (domain edgesL'),
sourceId e == applyNodeIdUnsafe edgesL' u,
targetId e == applyNodeIdUnsafe edgesL' v]
Perhaps
[(edgeId e, u, v) | e <- orphanTypedEdges m,
u <- nodeIds (domain edgesL'),
sourceId e == applyNodeIdUnsafe edgesL' u,
v <- nodeIds (domain edgesL'),
targetId e == applyNodeIdUnsafe edgesL' v]
Replace case with fromMaybe Open
Open
getNode id = case lookup id nodes of
Nothing -> error $ "edgeInContext: malformed graph, lookup of edge " ++ show id ++ " failed"
Just n -> n
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
case lookup id nodes of
Nothing -> error $
"edgeInContext: malformed graph, lookup of edge " ++
show id ++ " failed"
Just n -> n
Perhaps
fromMaybe
(error $
"edgeInContext: malformed graph, lookup of edge " ++
show id ++ " failed")
(lookup id nodes)
Use $> Open
Open
<|> (reserved "AG" *> pure (A . G))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
reserved "AG" *> pure (A . G)
Perhaps
reserved "AG" Data.Functor.$> (A . G)
Use infix Open
Open
(_,edges) = L.partition (\((_,_,label),_) -> L.isPrefixOf "type:" label) types
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
L.isPrefixOf "type:" label
Perhaps
"type:" `isPrefixOf` label
Use fmap Open
Open
, ("toString", haskellFn1 globalState $ \idx ->
show . pretty <$> lookupGrLangValue idx
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
\ idx -> show . pretty <$> lookupGrLangValue idx
Perhaps
(fmap (show . pretty) . lookupGrLangValue)
Redundant bracket Open
Open
injEdges = filter (\x -> (all (\e' -> TGM.applyEdgeIdUnsafe n e' /= x) (TG.edgeIds $ TGM.domainGraph n))) (TG.edgeIds $ TGM.codomainGraph n)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
\ x ->
(all (\ e' -> TGM.applyEdgeIdUnsafe n e' /= x)
(TG.edgeIds $ TGM.domainGraph n))
Perhaps
\ x ->
all (\ e' -> TGM.applyEdgeIdUnsafe n e' /= x)
(TG.edgeIds $ TGM.domainGraph n)
Reduce duplication Open
Open
assertBool "rhs morphism is monic" (isMonic $ rightMorphism r)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
assertBool "rhs morphism is monic" (isMonic $ rightMorphism r)
assertBool "rhs morphism is not iso"
(not . isIsomorphism $ rightMorphism r)
assertEqual "NACs" [] (nacs r)
Perhaps
Combine with tests/GrLang/CompilerSpec.hs:400:7
Reduce duplication Open
Open
Map.keys values `shouldBe` ["r"]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
Map.keys values `shouldBe` ["r"]
let VRule r = Ann.drop $ values Map.! "r"
assertValidRule r
assertEqual "LHS"
(fromNodesAndEdges tgraph
[(Node 0 "r1", 1), (Node 1 "r2", 1), (Node 2 "d1", 2),
(Node 3 "d2", 2)]
[(Edge 0 0 2 "r1", 1), (Edge 1 1 3 "r2", 1)])
(leftObject r)
Perhaps
Combine with tests/GrLang/CompilerSpec.hs:325:7
Use $> Open
Open
<|> (reserved "EX" *> pure (E . X))
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
reserved "EX" *> pure (E . X)
Perhaps
reserved "EX" Data.Functor.$> (E . X)
Move guards forward Open
Open
edgesFromA = [(edgeId e, u, v) |
e <- orphanTypedEdges m,
u <- nodeIdsFromDomain edgesL',
v <- nodeIdsFromDomain edgesL',
sourceId e == applyNodeIdUnsafe edgesL' u,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
[(edgeId e, u, v) | e <- orphanTypedEdges m,
u <- nodeIdsFromDomain edgesL', v <- nodeIdsFromDomain edgesL',
sourceId e == applyNodeIdUnsafe edgesL' u,
targetId e == applyNodeIdUnsafe edgesL' v]
Perhaps
[(edgeId e, u, v) | e <- orphanTypedEdges m,
u <- nodeIdsFromDomain edgesL',
sourceId e == applyNodeIdUnsafe edgesL' u,
v <- nodeIdsFromDomain edgesL',
targetId e == applyNodeIdUnsafe edgesL' v]
Use infix Open
Open
nacNames = filter (\(x,_) -> isPrefixOf "NAC" x) names
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
isPrefixOf "NAC" x
Perhaps
"NAC" `isPrefixOf` x
Reduce duplication Open
Open
Map.keys values `shouldBe` ["g"]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
Map.keys values `shouldBe` ["g"]
let VGraph g = Ann.drop $ values Map.! "g"
g `shouldBe`
fromNodesAndEdges tgraph [(Node 0 "n1", 1), (Node 1 "n2", 1)]
[(Edge 0 0 1 "e1", 1), (Edge 1 0 1 "e2", 1)]
Perhaps
Combine with tests/GrLang/CompilerSpec.hs:192:7
Reduce duplication Open
Open
Map.keys values `shouldBe` ["commit"]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
Map.keys values `shouldBe` ["commit"]
let VRule r = Ann.drop $ values Map.! "commit"
assertValidRule r
assertEqual "LHS"
(fromNodesAndEdges tgraph [(Node 0 "r1", 1), (Node 1 "d1", 2)]
[(Edge 0 0 1 . Just $ Metadata Nothing Nothing, 1)])
(leftObject r)
Perhaps
Combine with tests/GrLang/CompilerSpec.hs:377:7
Use camelCase Open
Open
class Category morph => E'PairCofinitary morph where
-- | Check if the given pair of morphisms \(X \overset{f}{\to} Z
-- \overset{g}{\leftarrow} Y\) belongs to the class \(\mathcal{E}'\) of joint
-- surjections. The behaviour is undefined if the given morphisms have
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
class Category morph => E'PairCofinitary morph where
isJointSurjection :: (morph, morph) -> Bool
findJointSurjections ::
(MorphismClass morph, Obj morph)
-> (MorphismClass morph, Obj morph) -> [(morph, morph)]
default findJointSurjections ::
(ECofinitary morph, Cocomplete morph) =>
(MorphismClass morph, Obj morph)
-> (MorphismClass morph, Obj morph) -> [(morph, morph)]
findJointSurjections (c1, x) (c2, y)
= let (jx, jy) = calculateCoproduct x y
in
[(f, g) |
e <- findAllQuotientsOf (codomain jx),
let (f, g) = (e <&> jx, e <&> jy),
f `belongsToClass` c1,
g `belongsToClass` c2]
findJointSurjectionSquares ::
(MorphismClass morph, morph)
-> (MorphismClass morph, morph) -> [(morph, morph)]
findJointSurjectionSquares (cf, f) (cg, g)
= [(f', g') |
(g', f') <- findJointSurjections (cf, codomain f) (cg, codomain g),
g' <&> f == f' <&> g]
Perhaps
class Category morph => EPairCofinitary morph where
isJointSurjection :: (morph, morph) -> Bool
findJointSurjections ::
(MorphismClass morph, Obj morph)
-> (MorphismClass morph, Obj morph) -> [(morph, morph)]
default findJointSurjections ::
(ECofinitary morph, Cocomplete morph) =>
(MorphismClass morph, Obj morph)
-> (MorphismClass morph, Obj morph) -> [(morph, morph)]
findJointSurjections (c1, x) (c2, y)
= let (jx, jy) = calculateCoproduct x y
in
[(f, g) |
e <- findAllQuotientsOf (codomain jx),
let (f, g) = (e `<&>` jx, e `<&>` jy),
f `belongsToClass` c1,
g `belongsToClass` c2]
findJointSurjectionSquares ::
(MorphismClass morph, morph)
-> (MorphismClass morph, morph) -> [(morph, morph)]
findJointSurjectionSquares (cf, f) (cg, g)
= [(f', g') |
(g', f') <- findJointSurjections (cf, codomain f) (cg, codomain g),
g' `<&>` f `==` f' `<&>` g]
Reduce duplication Open
Open
(fL, fR) = (mappingLeft f, mappingRight f)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
(fL, fR) = (mappingLeft f, mappingRight f)
(gL, gR) = (mappingLeft g, mappingRight g)
cls = toFstOrderMorphismClass cls'
Perhaps
Combine with src/library/Category/TypedGraphRule/FindMorphism.hs:44:7
Use $> Open
Open
reserved "U" *> pure U
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
reserved "U" *> pure U
Perhaps
(reserved "U" Data.Functor.$> U)
Redundant bracket Open
Open
injNodes = filter (\x -> (all (\n' -> TGM.applyNodeIdUnsafe n n' /= x) (TG.nodeIds $ TGM.domainGraph n))) (TG.nodeIds $ TGM.codomainGraph n)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Found
\ x ->
(all (\ n' -> TGM.applyNodeIdUnsafe n n' /= x)
(TG.nodeIds $ TGM.domainGraph n))
Perhaps
\ x ->
all (\ n' -> TGM.applyNodeIdUnsafe n n' /= x)
(TG.nodeIds $ TGM.domainGraph n)