T4rk1n/tarkjs

View on GitHub

Showing 30 of 36 total issues

Function promise has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const promise = new Promise((resolve, reject) => {
const handle = () => {
let result
 
try { result = func(...args) }
Severity: Minor
Found in src/extensions/prom-extensions.js - About 1 hr to fix

    Function createElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export const createElement = (container, elementId, options=defaultCreateElementOptions) => {
    let element = document.getElementById(elementId)
    if (!element) {
    const {
    elementType, attributes, innerHtml, onload, front, insert
    Severity: Minor
    Found in src/dom/dom-manipulations.js - About 1 hr to fix

    Function chainPromises has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export const chainPromises = (creators, options=defaultChainOptions) => {
    let canceled = false, cancel = () => canceled = true
    const { onChain, onError, rejectOnError } = objExtend({}, defaultChainOptions, options)
    const promise = new Promise((resolve, reject) => {
    let i = 0, acc = []
    Severity: Minor
    Found in src/extensions/prom-extensions.js - About 1 hr to fix

    Function globalScope has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export const globalScope = (() => {
    // eslint-disable-next-line no-undef
    const glob = typeof module !== 'undefined' && module.exports ? global
    : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}
     
     
    Severity: Minor
    Found in src/global-scope.js - About 1 hr to fix

    Function loadImageChain has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const loadImageChain = (baseurl, extension, start) => {
    let i = start, cancel = () => {}, canceled = false, cur
    const images = []
    const promise = new Promise((resolve, reject) => {
    const onStop = (e) => {
    Severity: Minor
    Found in src/dom/loaders.js - About 1 hr to fix

      Function fetchRequest has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const fetchRequest = (url, init={}) => {
      let canceled
      const promise = new Promise((resolve, reject) => {
      fetch(url, init).then((rep) => {
      if (canceled) reject({
      Severity: Minor
      Found in src/requests/requests.js - About 55 mins to fix

      Function rollImages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const rollImages = (canvas, imageList, options=rollImagesOptions) => {
      const { refreshRate, width, height, startX, startY, loop } = objExtend({}, rollImagesOptions, options)
      const ctx = canvas.getContext('2d')
      let canceled = false,
      cancel = () => canceled = true,
      Severity: Minor
      Found in src/dom/canvas.js - About 55 mins to fix

      Function loadImageChain has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const loadImageChain = (baseurl, extension, start) => {
      let i = start, cancel = () => {}, canceled = false, cur
      const images = []
      const promise = new Promise((resolve, reject) => {
      const onStop = (e) => {
      Severity: Minor
      Found in src/dom/loaders.js - About 55 mins to fix

      Function fadeIn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export const fadeIn = (elem, options=defaultFadeInOptions) => {
      const { display, division } = objExtend({}, defaultFadeInOptions, options)
      elem.style.opacity = 0
      elem.style.display = display
      const increment = 1 / division
      Severity: Minor
      Found in src/dom/animations/animations.js - About 35 mins to fix

      Function fadeOut has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export const fadeOut = (elem, options=defaultAnimationOptions) => {
      const { division } = {...defaultAnimationOptions, ...options}
      elem.style.opacity = 1
      const increment = 1 / division
      let canceled = false
      Severity: Minor
      Found in src/dom/animations/animations.js - About 35 mins to fix
      Severity
      Category
      Status
      Source
      Language