Showing 292 of 292 total issues

Reduce duplication
Open

      q <- newName "q"
Severity: Minor
Found in flaw-math/Flaw/Math.hs by hlint

Found

q <- newName "q"
s <- newName "s"
f <- newName "f"
h <- newName "h"
t <- newName "t"

Perhaps

Combine with flaw-math/Flaw/Math.hs:565:7

Redundant do
Open

  lns <- sqliteQuery stmt $ \query -> do
    let
      step = do
        r <- sqliteStep query
        if r then do
Severity: Minor
Found in flaw-oil/Flaw/Oil/Repo.hs by hlint

Found

do let step
         = do r <- sqliteStep query
              if r then
                do line <- sqliteColumn query 0
                   restLines <- step
                   return $ line : restLines
                else return []
     in step

Perhaps

let step
      = do r <- sqliteStep query
           if r then
             do line <- sqliteColumn query 0
                restLines <- step
                return $ line : restLines
             else return []
  in step

Reduce duplication
Open

    check b "k3" 0 ""
Severity: Minor
Found in flaw-oil/test/repo-test.hs by hlint

Found

check b "k3" 0 ""
psp a
psp b
check a "k1" 1 "aaa111"
check a "k2" 2 "aaa222"

Perhaps

Combine with flaw-oil/test/repo-test.hs:248:5

Use forM_
Open

          case maybeOldLayoutPanelChild of
            Just oldLayoutPanelChild -> removeFreeChild panel oldLayoutPanelChild
            Nothing -> return ()
Severity: Minor
Found in flaw-editor/exe/editor.hs by hlint

Found

case maybeOldLayoutPanelChild of
    Just oldLayoutPanelChild -> removeFreeChild panel
                                  oldLayoutPanelChild
    Nothing -> return ()

Perhaps

Data.Foldable.forM_ maybeOldLayoutPanelChild
  (removeFreeChild panel)

Use gets
Open

tryGetElementById name = MS.lookup name . ccElementsById <$> get
Severity: Minor
Found in flaw-collada/Flaw/Asset/Collada.hs by hlint

Found

MS.lookup name . ccElementsById <$> get

Perhaps

gets (MS.lookup name . ccElementsById)

Reduce duplication
Open

    k = sqrt (1 + m11 + m22 + m33)
Severity: Minor
Found in flaw-math/Flaw/Math/Transform.hs by hlint

Found

k = sqrt (1 + m11 + m22 + m33)
kk = 0.5 / k
x = (m32 - m23) * kk
y = (m13 - m31) * kk
z = (m21 - m12) * kk
w = k * 0.5

Perhaps

Combine with flaw-math/Flaw/Math/Transform.hs:201:5

Unused LANGUAGE pragma
Open

{-# LANGUAGE FlexibleContexts, FlexibleInstances, FunctionalDependencies, MultiParamTypeClasses, OverloadedStrings, RankNTypes #-}
Severity: Minor
Found in flaw-collada/Flaw/Asset/Collada.hs by hlint

Found

{-# LANGUAGE FlexibleContexts, FlexibleInstances,
  FunctionalDependencies, MultiParamTypeClasses, OverloadedStrings,
  RankNTypes #-}

Perhaps

{-# LANGUAGE FlexibleContexts, FlexibleInstances,
  FunctionalDependencies, OverloadedStrings, RankNTypes #-}

Applying this change:

  • Extension MultiParamTypeClasses is implied by FunctionalDependencies

Reduce duplication
Open

    check b "k2" 0 ""
Severity: Minor
Found in flaw-oil/test/repo-test.hs by hlint

Found

check b "k2" 0 ""
check b "k3" 0 ""
psp a
psp b
check a "k1" 1 "aaa111"

Perhaps

Combine with flaw-oil/test/repo-test.hs:239:5

Reduce duplication
Open

    albedo = xyz__ albedoOcclusion

Found

albedo = xyz__ albedoOcclusion
diffuse = x_ material
specular = y_ material
metalness = zzz__ material
glossiness = w_ material

Perhaps

Combine with flaw-visual/Flaw/Visual/Pipeline/Deferred.hs:226:5

Use tuple-section
Open

    [ newtypeInstD (sequence []) ''Quat [elemType] Nothing (normalC conName [fmap (\t -> (Bang NoSourceUnpackedness NoSourceStrictness, t)) [t| Vec4 $elemType |]]) [derivClause Nothing [ [t| Generic |] ] ]
Severity: Minor
Found in flaw-math/Flaw/Math.hs by hlint

Found

\ t -> (Bang NoSourceUnpackedness NoSourceStrictness, t)

Perhaps

(Bang NoSourceUnpackedness NoSourceStrictness,)

Applying this change:

  • may require {-# LANGUAGE TupleSections #-} adding to the top of the file

Use gets
Open

  getParsedArrays = ccFloatArrays <$> get
Severity: Minor
Found in flaw-collada/Flaw/Asset/Collada.hs by hlint

Found

ccFloatArrays <$> get

Perhaps

gets ccFloatArrays

Use gets
Open

  settings <- ccSettings <$> get
Severity: Minor
Found in flaw-collada/Flaw/Asset/Collada.hs by hlint

Found

ccSettings <$> get

Perhaps

gets ccSettings

Reduce duplication
Open

            glGetProgramiv programName GL_LINK_STATUS statusPtr
Severity: Minor
Found in flaw-gl/Flaw/Graphics/GlContext.hs by hlint

Found

glGetProgramiv programName GL_LINK_STATUS statusPtr
glCheckErrors0 "get program link status"
peek statusPtr

Perhaps

Combine with flaw-gl/Flaw/Graphics/GlContext.hs:737:9

Use camelCase
Open

glGetUniformBlockIndex_s programName uniformBlockName = B.useAsCString (T.encodeUtf8 uniformBlockName) $ glGetUniformBlockIndex programName
Severity: Minor
Found in flaw-gl/Flaw/Graphics/OpenGL/FFI.hs by hlint

Found

glGetUniformBlockIndex_s programName uniformBlockName = ...

Perhaps

glGetUniformBlockIndexS programName uniformBlockName = ...

Use camelCase
Open

glGetProgramInfoLog_s :: JS_WebGLProgram -> IO T.Text
Severity: Minor
Found in flaw-gl/Flaw/Graphics/WebGL/FFI.hs by hlint

Found

glGetProgramInfoLog_s :: JS_WebGLProgram -> IO T.Text

Perhaps

glGetProgramInfoLogS :: JS_WebGLProgram -> IO T.Text

Use camelCase
Open

glGetUniformLocation_s :: JS_WebGLProgram -> T.Text -> IO JS_WebGLUniformLocation
Severity: Minor
Found in flaw-gl/Flaw/Graphics/WebGL/FFI.hs by hlint

Found

glGetUniformLocation_s ::
  JS_WebGLProgram -> T.Text -> IO JS_WebGLUniformLocation

Perhaps

glGetUniformLocationS ::
  JS_WebGLProgram -> T.Text -> IO JS_WebGLUniformLocation

Use infix
Open

      variantFilter variant = all (\c -> elem c components) variant && elem (last components) variant

Found

elem c components

Perhaps

c `elem` components

Redundant bracket
Open

                ( (bindS (varP p) [| readMutVar $(r j) |]) : restStmts ++
                  [bindS (varP q) [| luaValueConcat $(varE p) $restE |] ]
Severity: Minor
Found in flaw-lua/Flaw/Script/Lua/Chunk.hs by hlint

Found

(bindS (varP p) [| readMutVar $( r j ) |]) :
  restStmts ++
    [bindS (varP q) [| luaValueConcat $( varE p ) $restE |]]

Perhaps

bindS (varP p) [| readMutVar $( r j ) |] :
  restStmts ++
    [bindS (varP q) [| luaValueConcat $( varE p ) $restE |]]

Use camelCase
Open

data C_OSMesaContext

Found

data C_OSMesaContext

Perhaps

data COSMesaContext

Use list comprehension
Open

    otherShaderInfos = concatMap (\(otherStage, otherShaderInfo) -> if otherStage == stage then [] else [otherShaderInfo]) shaders
Severity: Minor
Found in flaw-gl/Flaw/Graphics/GLSL.hs by hlint

Found

if otherStage == stage then [] else [otherShaderInfo]

Perhaps

[otherShaderInfo | not (otherStage == stage)]
Severity
Category
Status
Source
Language